-
Notifications
You must be signed in to change notification settings - Fork 887
data race related to dRPC / yamux #2429
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
data race related to dRPC / yamux #2429
Comments
Ok, I think this one is related to this snippet of code in dRPC
It calls
That's actually fine for dRPC to be doing because, according to io.Writer's docs, implementations are not allowed to retain the byte slice after they return from Write. A write to a yamux session eventually hits this function, where
Notice that the body gets put on a channel, and then we wait for the response to come back, or crucially, the channel to be shut down or a time out. The This case is consistent with the stack trace of the data race: the main RPC response hits an error like timeout or shutdown, and then dRPC attempts to write an error to the stream: Handling shutdown should be relatively straightforward: the goroutine that processes the |
I’m glad you opened this issue Spike! I believe I identified the same issue in: hashicorp/yamux#100 but the project seems kinda dead, so it fell into limbo. If we’re going to continue using yamux, we’ll need to fork. I’d be in favor of replacing it entirely though. |
This commit takes a minimal approach to fixing unsafe header re-use during close and timeout by reallocating the header in those cases. Partially fixes: coder/coder#2429 Related: hashicorp#40
https://github.com/coder/coder/runs/6923689367
snip:
Could be related to #2417
The text was updated successfully, but these errors were encountered: