-
Notifications
You must be signed in to change notification settings - Fork 7
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
add stress tests and fix broken pipe when send too fast #124
Conversation
// hard-coded to 1 minute for now. This indicates a system | ||
// is very backed up, and is here just to prevent forever hangs | ||
std::time::Duration::from_secs(60), |
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.
lemme know if y'all are okay with this as an outside safeguard, or if it needs to be configurable
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.
This begs the question if there's something wrong with the channel, so to say? If the async method does not overflow it but the sync one does.
Is it a problem now that the channel doesn't get closed anymore if sending fails?
This is exactly the solution... because the async one will wait until there is space before pushing the new message on.
The channel does get closed on send failure. There's a match at the end of that function that does it. |
Okay, that wasn't obvious to me from the docs. |
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.
Yay for stress tests and this fix looks reasonable to me.
I think having some timeout is reasonable for now. It might give more context to require people making a network request to decide their own timeout but that's an adjustment we can make later if needed. It's good to have something in place for now
RESOLVES: #123