We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I used about 10 goroutines to execute the conn.WriteJSON method concurrently, and the following panic occurred:
goroutine 18450 [running]: github.com/gorilla/websocket.(*messageWriter).flushFrame(0xc000ea8990, 0x1, {0x0?, 0x0?, 0x0?}) D:/projects/go/pkg/mod/github.com/gorilla/websocket@v1.5.1/conn.go:632 +0x4b8 github.com/gorilla/websocket.(*messageWriter).Close(0x1306a90?) D:/projects/go/pkg/mod/github.com/gorilla/websocket@v1.5.1/conn.go:746 +0x35 github.com/gorilla/websocket.(*Conn).beginMessage(0xc0012d0160, 0xc000ea8a50, 0x1) D:/projects/go/pkg/mod/github.com/gorilla/websocket@v1.5.1/conn.go:493 +0x47 github.com/gorilla/websocket.(*Conn).NextWriter(0xc0012d0160, 0x1) D:/projects/go/pkg/mod/github.com/gorilla/websocket@v1.5.1/conn.go:535 +0x3f github.com/gorilla/websocket.(*Conn).WriteJSON(0xba577e?, {0xaaa0e0, 0xc000ea8a20}) D:/projects/go/pkg/mod/github.com/gorilla/websocket@v1.5.1/json.go:24 +0x34 github.com/gzw13999/gows/spot.(*Api).CancelOrder(0xc000185960, {{0xc0012afca0, 0x8}, {0x0, 0x0}, {0x0, 0x0}, 0x2, 0x5, 0x0, ...}, ...) D:/projects/go/src/github.com/gzw13999/gows/prv.go:285 +0x369 github.com/gzw13999/qu/strat.(*Strategy5).cancelOrder(...)
Can't conn.WriteJSON be executed concurrently?
There should not be a panic that causes the program to terminate.
The access is to a third-party API and no recurrence pattern has been found yet.
No response
The text was updated successfully, but these errors were encountered:
Got it, it turns out concurrency is not supported
Sorry, something went wrong.
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
No branches or pull requests
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: