-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
WriteMessage does not respect deadline acquring mutex [bug] #704
Comments
WriteMessage does not compete with other calls to WriteMessage because only one concurrent writer is supported. The problem is that WriteMessage can wait longer than specified deadline when WriteMessage waits on a call to WriteControl. This is probably not a big problem in practice, but the problem should be fixed. Fix by creating a function to acquire the mutex with deadline and call that function from both code paths. The function should avoid creating the ticker when there's no contention.
|
Hi, I'm trying to understand this. Do this mean to use |
Unlike
WriteControl
,WriteMessage
does not attempt to honor the deadline while acquiring the mutex.WriteMessage
websocket/conn.go
Lines 378 to 380 in b65e629
WriteControl
websocket/conn.go
Lines 432 to 447 in b65e629
It's not clear whether this can actually cause an issue, but it is certainly suspicious.
The text was updated successfully, but these errors were encountered: