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

Lost send in Channel during close #359

Closed
qwwdfsad opened this issue May 14, 2018 · 0 comments
Closed

Lost send in Channel during close #359

qwwdfsad opened this issue May 14, 2018 · 0 comments
Assignees
Labels

Comments

@qwwdfsad
Copy link
Collaborator

The following code may lose send coroutine:

T1: channel.send()
T2 channel.receive(); channel.close()

close is not atomic and can be considered as two actions: "remove and cancel waiting receivers" and "add closed token". If send occurs between these actions, send will be stuck in the channel

@qwwdfsad qwwdfsad added the bug label May 14, 2018
@qwwdfsad qwwdfsad self-assigned this May 14, 2018
@qwwdfsad qwwdfsad mentioned this issue May 16, 2018
qwwdfsad added a commit that referenced this issue Jul 17, 2018
Make close, cancel, isClosedForSend, isClosedForReceive and offer linearizable with other operations
Fix bug when send operation can be stuck in channel forever
New concurrency tests

Fixes #359
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant