tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rémy Maucherat <r...@apache.org>
Subject Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener
Date Thu, 30 Jan 2014 16:39:13 GMT
2014-01-30 Yann Simon <yann.simon.fr@gmail.com>:

> Hi,
>
> I wrote a sample app to demonstrate the problem:
> https://github.com/yanns/servlet31_async
>
> You can generate an exploded war with maven: mvn war:exploded
> I deployed the application in tomcat 8.0.0-RC10.
>
> The 2 upload form does work.
> The 1st upload form uses a new thread in , and that does not work.
>
> https://github.com/yanns/servlet31_async/blob/master/src/main/java/com/yann/ReadListenerImpl.java#L22
>
> The "onDataAvailable" is called only one time.
>
> With jetty, it does work (mvn jetty:run)
>
> I hope this can help.
>

You must read data until the ready flag flips, and you must do it in the
onDataAvailable invocation (= synchronously). Asynchronous reads is not the
threading and sync model that was chosen by the specification, so you
should simply not do that. I doubt it will reliably work in any container
since it is almost certain you can run in thread safety issues.

Rémy

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message