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

wrap close(wait) with sync.Once to avoid panic #6800

Merged
merged 2 commits into from
Jul 20, 2021

Conversation

nonsense
Copy link
Member

@nonsense nonsense commented Jul 20, 2021

Closes #6792


Fixes the panic described in the issue. Clients are reading up until EOF error, and at that point if Close() is called, the process was crashing.

@nonsense nonsense marked this pull request as ready for review July 20, 2021 10:24
@nonsense nonsense requested a review from a team as a code owner July 20, 2021 10:24
@nonsense nonsense requested review from magik6k and raulk July 20, 2021 10:24
@raulk raulk force-pushed the nonsense/fix-double-close-panic branch from 2f69acf to 1a1bace Compare July 20, 2021 13:23
Copy link
Member

@raulk raulk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some godocs to document the behaviour of this magik-al component.

@raulk raulk enabled auto-merge July 20, 2021 13:23
@raulk raulk force-pushed the nonsense/fix-double-close-panic branch from 1a1bace to 26a6740 Compare July 20, 2021 13:24
@@ -134,7 +145,9 @@ func ReaderParamDecoder() (http.HandlerFunc, jsonrpc.ServerOption) {
}

select {
case <-wr.wait:
case <-wr.watch:
// TODO should we check if we failed the Read, and if so
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but a followup patch sounds reasonable.

@Stebalien Stebalien force-pushed the nonsense/fix-double-close-panic branch from 1510ab7 to 8413c08 Compare July 20, 2021 22:43
@raulk raulk merged commit c1f0ebb into master Jul 20, 2021
@raulk raulk deleted the nonsense/fix-double-close-panic branch July 20, 2021 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Runtime Segregation cause panic and crash
3 participants