-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API] increase api listener limit #4374
Conversation
return status.Error(codes.Internal, err.Error()) | ||
} | ||
err := <-errChan | ||
err = <-errChan | ||
chainListener.RemoveResponder(id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
receiving the errChan means the end of the StreamBlocks
chainListener := svr.coreService.ChainListener() | ||
streamID, err := chainListener.AddResponder(NewWeb3BlockListener(writer.Write)) | ||
if err != nil { | ||
return nil, err | ||
} | ||
ctx.AddListener(streamID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and add here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the removing should after wss disconnected, not here
for _, id := range sc.ListenerIDs() { | ||
wsSvr.coreService.ChainListener().RemoveResponder(id) | ||
} | ||
} | ||
for { | ||
select { | ||
case <-ctx.Done(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here should also call cancel
to clean up (remove all responder)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
Quality Gate passedIssues Measures |
Description
Temporarily relax #4373 , increase global listen limits to 5000 from 500
Ultimately, the api
eth_subscribe
andeth_unsubscribe
should only take effect for websockets, and related listeners should be cleaned up after the connection is disconnected. The limitations can also be revised to apply to the number of listeners per connection.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: