Skip to content

Commit d516bfb

Browse files
authored
Increase MaxConcurrentRelaysPerRequest and improve log (#482)
- Add amount of requests on the payload to the log. - Increase MaxConcurrentRelaysPerRequest to 5.5k
1 parent cb4a452 commit d516bfb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

protocol/shannon/context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const maxEndpointPayloadLenForLogging = 100
4646
// MaxConcurrentRelaysPerRequest limits the number of concurrent relay goroutines per request.
4747
// This prevents DoS attacks via large batch requests that could spawn unbounded goroutines.
4848
// TODO_IMPROVE: Make this configurable via gateway settings.
49-
const MaxConcurrentRelaysPerRequest = 10
49+
const MaxConcurrentRelaysPerRequest = 5500
5050

5151
// requestContext provides all the functionality required by the gateway package
5252
// for handling a single service request.
@@ -164,7 +164,7 @@ func (rc *requestContext) HandleServiceRequest(payloads []protocol.Payload) ([]p
164164
}
165165

166166
if len(payloads) > MaxConcurrentRelaysPerRequest {
167-
response, err := rc.handleInternalError(fmt.Errorf("HandleServiceRequest: batch of payloads larger than allowed: %d", MaxConcurrentRelaysPerRequest))
167+
response, err := rc.handleInternalError(fmt.Errorf("HandleServiceRequest: batch of payloads larger than allowed: %d, received: %d ", MaxConcurrentRelaysPerRequest, len(payloads)))
168168
return []protocol.Response{response}, err
169169
}
170170

0 commit comments

Comments
 (0)