besu icon indicating copy to clipboard operation
besu copied to clipboard

Allow `maxActiveConnections` for GraphQL and terminate requests based on actual connection status

Open Wetitpig opened this issue 1 year ago • 4 comments

PR description

  1. The option of --graphql-http-max-active-connections has been added to limit the numer of GraphQL requests served each time.
  2. The GraphQL server has been relying on an isAliveHandler to terminate requests based on the timeout. However, this handler was only applied to matchingLogs, resulting in unterminated GraphQL executions in general even if the connection has timed out. Rather than relying on a future task, it is more appropriate to terminate requests based on the actual status of the connection. The TimeoutHandler should have handled the HTTP timeout while connections may also be terminated due to exceeding maxActiveConnections.

Docs change would be added in another PR in a later stage when code changes stabilise.

Fixed Issue(s)

Wetitpig avatar Nov 30 '23 15:11 Wetitpig

  • [ ] I thought about documentation and added the doc-change-required label to this PR if updates are required.
  • [ ] I thought about the changelog and included a changelog update if required.
  • [ ] If my PR includes database changes (e.g. KeyValueSegmentIdentifier) I have thought about compatibility and performed forwards and backwards compatibility tests

github-actions[bot] avatar Nov 30 '23 15:11 github-actions[bot]

There is also a refactoring of the GraphQL tests to a base class with all server start and end methods.

Wetitpig avatar Dec 01 '23 03:12 Wetitpig

Quite a number of methods common to all HTTP services (CORS checking, Hostlist checking etc.) were relocated to reuse code. A parent class HttpConfiguration has been created. Are there suggestions to a better name?

Wetitpig avatar Dec 02 '23 05:12 Wetitpig

@macfarla @shemnon I am now implementing only changes for max connections and timeout. The rest is to be implemented later.

Wetitpig avatar Feb 25 '24 10:02 Wetitpig