-
Notifications
You must be signed in to change notification settings - Fork 291
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
Limit concurrency #1710
Limit concurrency #1710
Conversation
Allow at most 32 concurrent messages and 16384 pending messages. Tail-drop excess messages.
Wondering if we should have go routine wrapper, like |
Thought about doing so, but didn't go for it because it would lose type safety: the intake channel's type must be made generic ( This is a cost-benefit trade off. I'd say factor the logic out if we do this maybe the third time. (O generics, where art thou…?) |
This obviates polling logic for receiver being nil.
Because, less copy-and-paste-ism = win.
This aids testing too.
39ec270
to
5c6fb65
Compare
LGTM, [sidenote, it would be better if it support prioritization scheduling of the messages. Consensus should take higher priority] |
Do not spawn unbounded number of goroutines for parallel message processing. Instead, use a worker pool of 32 goroutines sharing the same intake queue. Log (
"rx overrun"
) and tail-drop messages if the queue is full.Tests
Local test pass; 100% coverage of the newly added core code (
./msgq
):TODO