-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
WebSocket DeadLock In Javalin 5.6.1 Jetty 11.0.15 #11421
Comments
This is completely normal and it's not a deadlock. Jetty uses multiple threads for accepting as explained here: Please also consider closing the Javalin issue, as it is completely normal behavior. @gregw time to set the default number of acceptors to 1? |
Thank you very much for your reply.
If I set acceptQueueSize to 1, does this still happen when I have multiple WebSocket links? Or how do I set up to avoid new WebSocket links that do not respond to messages due to acceptors? |
@dlwss So the idea with the lock and multiple acceptor threads is that at any time only 1 thread is do an accept call, but if you have N acceptor threads, then N-1 should be waiting at that lock to start accepting as soon as a connection has been accepted by the first thread and it is processing it. In practise, the time it takes to create a new connection around a newly accepted thread is very very small, so the "little moment" is typically not a concern. Thus acceptors==1 is a reasonable value and we should make it the default..... actually I think we also support acceptors==0, for asynchronous accepting of connections from the selectors. @sbordet would that be a better default? |
@dlwss
This is not clear. What's exactly a "WebSocket link"? Can you please state exactly your problem, not the solution you may have found, or Jetty implementation details (or configuration parameters) that you think are a problem, but they are not? Once you state your problem in detail, we can understand better what's going on and provide more detailed answers/solution to your problem. |
Jetty version(s)
OS type/version
centos7
Description
I used Javalin's WebSocket server, and when I ran it for a while, I found that from time to time, I would not receive messages from
the client
How to reproduce?
After running for a while
Additional context
you can see ,A lock race occurred between thread 39 and thread 41。
Also,It is a Jetty Code
then ,I looked at the Jetty and JDK code
Jetty
JDK11
I think it's the problem of the Jetty caller, but I can't find the root cause。
I also report this issue in javalin
The text was updated successfully, but these errors were encountered: