https://bz.apache.org/bugzilla/show_bug.cgi?id=66531

            Bug ID: 66531
           Summary: Threading model causes deadlocks
           Product: Tomcat 8
           Version: 8.5.72
          Hardware: Macintosh
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: WebSocket
          Assignee: dev@tomcat.apache.org
          Reporter: alexey.may...@servicenow.com
  Target Milestone: ----

Some tasks in Tomcat require a thread to run on. These tasks use the same
thread pool as processing for incoming messages. The deadlock happen when all
threads are busy handling incoming messages and all of them run a task which
waits on getting a thread which is not available.

Example: upon receiving a message, send a response. To implement this, we can
call getAsyncRemote().sendText(data, callback) from onMessage. Then wait for
callback.succeeded() in OnMessage. If all threads receive a message at the same
time, they will deadlock. 

To fix this, short circuit the callback execution in case if there are no spare
threads: fail it immediately on the same thread.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to