CCQ: Query server response channel too small (#3502)
This commit is contained in:
parent
0c6dc18975
commit
54a8fe784b
|
@ -175,7 +175,12 @@ func runP2P(ctx context.Context, priv crypto.PrivKey, port uint, networkID, boot
|
|||
Signatures: responses[requestSignature][digest],
|
||||
}
|
||||
delete(responses, requestSignature)
|
||||
pendingResponse.ch <- s
|
||||
select {
|
||||
case pendingResponse.ch <- s:
|
||||
logger.Debug("forwarded query response")
|
||||
default:
|
||||
logger.Error("failed to write query response to channel, dropping it")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.Warn("received observation by unknown guardian - is our guardian set outdated?",
|
||||
|
|
|
@ -26,7 +26,8 @@ type PendingResponses struct {
|
|||
|
||||
func NewPendingResponses() *PendingResponses {
|
||||
return &PendingResponses{
|
||||
pendingResponses: make(map[string]*PendingResponse),
|
||||
// Make this channel bigger than the number of responses we ever expect to get for a query.
|
||||
pendingResponses: make(map[string]*PendingResponse, 100),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue