Skip to content
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

Fix endless loop in Reset #57

Merged
merged 2 commits into from Oct 3, 2022
Merged

Fix endless loop in Reset #57

merged 2 commits into from Oct 3, 2022

Conversation

ondrej-fabry
Copy link
Member

@ondrej-fabry ondrej-fabry commented Oct 3, 2022

This change fixes a bug where the drain channel loop would run forever.
This happens when reqChan gets closed which makes the case with closed channel be selected instantly.
The fix is to set reqChan to nil which practically ignores that case in the select.

This change fixes a bug where the drain channel loop would run forever.
This happens when reqChan gets closed which makes the case with closed channel be selected instantly.
The fix is to set reqChan to nil which practically ignores that case in the select.

Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
@ondrej-fabry ondrej-fabry self-assigned this Oct 3, 2022
@ondrej-fabry ondrej-fabry added this to the v0.7.0 milestone Oct 3, 2022
core/channel.go Outdated Show resolved Hide resolved
- make the genericpool.Pool's Put method synchronous and invoke it asynchronously
- add debug message when draining occurs in Reset
- set replyChan to nil if closed (currently it never gets closed, but just to be sure)

Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
@sknat sknat merged commit c4a0cca into master Oct 3, 2022
@sknat sknat deleted the drain-fix branch October 3, 2022 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants