Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362854

Summary: Continuation implementations may deadlock
Product: [RT] Jetty Reporter: Simone Bordet <simone.bordet>
Component: serverAssignee: Simone Bordet <simone.bordet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: janb, jetty-inbox, ronny.voelker
Version: 7.5.4   
Target Milestone: 9.0.0.RC1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Simone Bordet CLA 2011-11-03 19:14:02 EDT
Continuation implementations may deadlock because they call listener callbacks with the continuation lock held.
If the listener callback performs some method call on the continuation, a deadlock may happen.

A case for this is available here for FauxContinuation: http://groups.google.com/group/cometd-users/browse_thread/thread/a5cef9c0af7ec577

However, AsyncContinuation is not immune: scheduleTimeout() is called with the continuation lock held, and it may call expired() for blocking endpoints, which notifies listeners.
Comment 1 Simone Bordet CLA 2013-02-13 10:03:39 EST
In Jetty 9, HttpChannelState (that replaced AsyncContinuation) is now free of the deadlock problem, because listeners are notified outside synchronized blocks.