-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[BUG] panic: concurrent write to websocket connection #913
Labels
Comments
Got it, it turns out concurrency is not supported |
The documentation describes the allowed concurrency. Concurrent writes are not allowed. A quick fix is to protect write to the connection with a mutex. |
Thank you, got it |
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Current Behavior
I used about 10 goroutines to execute the conn.WriteJSON method concurrently, and the following panic occurred:
Can't conn.WriteJSON be executed concurrently?
Expected Behavior
There should not be a panic that causes the program to terminate.
Steps To Reproduce
The access is to a third-party API and no recurrence pattern has been found yet.
Anything else?
No response
The text was updated successfully, but these errors were encountered: