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

Fixed a data race that occasionally causes a crash #1740

Merged
merged 3 commits into from
Apr 23, 2021

Conversation

STomperi
Copy link
Contributor

@STomperi STomperi commented Apr 1, 2021

if webSocketTransport.closeConnection() and webSocketTransport.initServer() are called in succession. Fix was verified with Xcode Thread sanitizer

@apollo-cla
Copy link

@STomperi: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@designatednerd
Copy link
Contributor

@STomperi thank you for adding the test! Would you mind checking if making acked use Atomic<Bool> also fixes the crash? I have some concerns about firing this off to a background queue if we don't have to.

@designatednerd
Copy link
Contributor

@STomperi Also, please sign the CLA when you get a chance - I will not be able to merge this without that.

@STomperi
Copy link
Contributor Author

STomperi commented Apr 8, 2021

@designatednerd Sorry for the delay. I tested with Atomic for acked. It fixes the data race for acked, but I still get data race in queue.keys.max() without firing to background queue:

Screen Shot 2021-04-08 at 15 45 38

@designatednerd
Copy link
Contributor

Blech, okay. Please sign the CLA, otherwise I can't merge this. Thank you!

Seppo Tomperi added 3 commits April 23, 2021 12:48
…ort.closeConnection() and webSocketTransport.initServer() are called in succession. Fix was verified with Xcode Thread sanitizer
@designatednerd
Copy link
Contributor

heads up that i've rebased to fix the merge conflict and am going to force-push to your branch so this becomes mergeable

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.

4 participants