fix queues

This commit is contained in:
tycho garen
2021-06-22 11:34:53 -04:00
parent 3616717500
commit 8afa250f8d
7 changed files with 19 additions and 23 deletions

View File

@@ -34,8 +34,7 @@ var (
SendQueueCapacity: 1000,
RecvBufferCapacity: 1024,
RecvMessageCapacity: bc.MaxMsgSize,
MaxSendBytes: 100,
MaxSendBytes: 100,
},
},
}

View File

@@ -36,8 +36,8 @@ var (
Priority: 8,
SendQueueCapacity: 64,
RecvMessageCapacity: maxMsgSize,
MaxSendBytes: 12000,
RecvBufferCapacity: 128,
MaxSendBytes: 12000,
},
},
DataChannel: {
@@ -51,8 +51,7 @@ var (
SendQueueCapacity: 64,
RecvBufferCapacity: 512,
RecvMessageCapacity: maxMsgSize,
MaxSendBytes: 40000,
MaxSendBytes: 40000,
},
},
VoteChannel: {
@@ -63,8 +62,7 @@ var (
SendQueueCapacity: 64,
RecvBufferCapacity: 128,
RecvMessageCapacity: maxMsgSize,
MaxSendBytes: 150,
MaxSendBytes: 150,
},
},
VoteSetBitsChannel: {
@@ -75,8 +73,7 @@ var (
SendQueueCapacity: 8,
RecvBufferCapacity: 128,
RecvMessageCapacity: maxMsgSize,
MaxSendBytes: 50,
MaxSendBytes: 50,
},
},
}

View File

@@ -31,8 +31,8 @@ var (
ID: byte(EvidenceChannel),
Priority: 6,
RecvMessageCapacity: maxMsgSize,
MaxSendBytes: 400,
RecvBufferCapacity: 32,
MaxSendBytes: 400,
},
},
}

View File

@@ -104,8 +104,8 @@ func GetChannelShims(config *cfg.MempoolConfig) map[p2p.ChannelID]*p2p.ChannelDe
ID: byte(mempool.MempoolChannel),
Priority: 5,
RecvMessageCapacity: batchMsg.Size(),
MaxSendBytes: 5000,
RecvBufferCapacity: 128,
MaxSendBytes: 5000,
},
},
}

View File

@@ -103,8 +103,8 @@ func GetChannelShims(config *cfg.MempoolConfig) map[p2p.ChannelID]*p2p.ChannelDe
ID: byte(mempool.MempoolChannel),
Priority: 5,
RecvMessageCapacity: batchMsg.Size(),
MaxSendBytes: 5000,
RecvBufferCapacity: 128,
MaxSendBytes: 5000,
},
},
}

View File

@@ -365,7 +365,7 @@ func (r *Router) createQueueFactory() (func(int) queue, error) {
// which internally makes the inbound, outbound, and error channel buffered.
func (r *Router) OpenChannel(chDesc ChannelDescriptor, messageType proto.Message, size int) (*Channel, error) {
if size == 0 {
size = queueBufferDefault
return nil, fmt.Errorf("must specify non-zero size for channel %d", chDesc.ID)
}
r.channelMtx.Lock()

View File

@@ -41,8 +41,8 @@ var (
Priority: 6,
SendQueueCapacity: 10,
RecvMessageCapacity: snapshotMsgSize,
MaxSendBytes: 400,
RecvBufferCapacity: 4096,
MaxSendBytes: 400,
},
},
ChunkChannel: {
@@ -52,8 +52,8 @@ var (
Priority: 3,
SendQueueCapacity: 4,
RecvMessageCapacity: chunkMsgSize,
MaxSendBytes: 400,
RecvBufferCapacity: 4096,
MaxSendBytes: 400,
},
},
LightBlockChannel: {
@@ -63,8 +63,8 @@ var (
Priority: 2,
SendQueueCapacity: 10,
RecvMessageCapacity: lightBlockMsgSize,
MaxSendBytes: 400,
RecvBufferCapacity: 4096,
MaxSendBytes: 400,
},
},
}