You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/12/12 12:20:01 UTC
[GitHub] massakam opened a new pull request #3172: Modify producer handler of WebSocket to send ack to client asynchrono…
massakam opened a new pull request #3172: Modify producer handler of WebSocket to send ack to client asynchrono…
URL: https://github.com/apache/pulsar/pull/3172
…usly
### Motivation
Recently, the WebSocket proxy in our Pulsar cluster hangs occasionally. A lot of connections in the CLOSE_WAIT state occur and the WebSocket proxy can not respond at all to requests from clients.
When checking the thread dump at this time, the IO thread is waiting forever for ack to be sent to the client.
https://gist.github.com/massakam/b0cffaf5f7361b94ec2a4dd13c672143#file-websocket_blocked_thread-txt
Some similar issues have been reported in the Jetty repository:
https://github.com/eclipse/jetty.project/issues/272
https://github.com/eclipse/jetty.project/issues/2061
The cause is still unknown, but this phenomenon seems to occur only when using blocking writes.
https://github.com/eclipse/jetty.project/issues/2061#issuecomment-420002658
### Modifications
When WebSocket proxy sends ack to client, it uses asynchronous write instead of blocking write.
### Result
It can be expected to avoid WebSocket hanging, but there is no confirmation.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services