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

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
flushBuffer() is a blocking I/O call.
It is used when non-blocking I/O was been configured.

This is illegal and the behaviour in this case is unspecified. See section 5.4
of the Servlet spec (bottom of page 5-48 in the final 4.0 spec)

<quote>
Registering a WriteListener will start non-blocking IO. It is illegal to switch
to the traditional blocking IO at that point. The use of IO related method
calls after this illegal switch to traditional blocking IO produces unspecified
behavior.
</quote>

I know some containers explicitly attempt to handle this by performing a
non-blocking I/O action rather than the blocking I/O action requested.

This isn't a use case we have implemented in Tomcat. It looks like the thread
performing the blocking flush() enters a wait() and never exists it because the
code that would trigger the exit executes the non-blocking branch rather than
the blocking branch.

I took a look to see if there was a simple way to trigger a non-blocking flush
rather than a blocking flush if applications behave this way. All the solutions
I've found so far are rather more invasive than I'd want to implement to
support what is - after all - not supported by the spec.

-- 
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