-
Notifications
You must be signed in to change notification settings - Fork 56
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
should not use netpoll with gobwas #18
Comments
Try to imagine that a connection comes, the netpoll event is passed to the pool, a goroutine of the pool will handle the upgrade, but this connection only sends a part of the bytes of the complete handshake message, because of its blocking mode, the handshake is blocked, then the goroutine is blocked. The handshake will return an error after the deadliner timeout and release the goroutine. Your server will be very slow to process new connections. Try again to imagine that after a successful ws handshake, the client starts to send data to the server, but only a part of the bytes of a complete ws message is sent, netpoll vent is passed to the pool, and a goroutine of the pool starts to read, because of its blocking mode, read ws message is blocked, then the goroutine is blocked. If many connections behave like this, all the goroutines of the pool will be blocked, and your service will become unavailable. |
This problem was discussed here: Now I'm going to close this. |
@lesismal is there an example to use gobwas with nbio? |
as I have said, gobwas has not implemented async-streaming-parsing, we should not use poller+gobwas but only use gobwas with std conn. nbio support websocket itsself: |
as I have said here:
gobwas/ws#121 (comment)
both gobwas's upgrade and wsutil/user.readRequest are blocking mode, if many connections send bytes one-by-one or send a half ws upgrade message or send only part of ws message, it will make all your gopool's task blocked, then your service not available.
try this client example:
The text was updated successfully, but these errors were encountered: