Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-25 Thread Yann Simon
2014-03-25 17:25 GMT+01:00 Caldarale, Charles R : >> From: Yann Simon [mailto:yann.simon...@gmail.com] >> Subject: Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with >> ReadListener > >> > Also, have you tried with the 8.0.5 release that is up for vote?

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-25 Thread Daniel Mikusa
On Mar 25, 2014, at 12:16 PM, Yann Simon wrote: > 2014-03-25 16:36 GMT+01:00 Daniel Mikusa : >> On Mar 25, 2014, at 11:25 AM, Yann Simon wrote: >> >>> 2014-03-20 15:28 GMT+01:00 Yann Simon : Thanks for all your input, I think I have now an implementation that works on Tomcat and Jetty

RE: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-25 Thread Caldarale, Charles R
> From: Yann Simon [mailto:yann.simon...@gmail.com] > Subject: Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with > ReadListener > > Also, have you tried with the 8.0.5 release that is up for vote? > I do not see this version anywhere. > Is there already an alpha/

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-25 Thread Yann Simon
2014-03-25 16:36 GMT+01:00 Daniel Mikusa : > On Mar 25, 2014, at 11:25 AM, Yann Simon wrote: > >> 2014-03-20 15:28 GMT+01:00 Yann Simon : >>> Thanks for all your input, I think I have now an implementation that >>> works on Tomcat and Jetty. >>> >>> By testing it, I've found something that can be

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-25 Thread Daniel Mikusa
On Mar 25, 2014, at 11:25 AM, Yann Simon wrote: > 2014-03-20 15:28 GMT+01:00 Yann Simon : >> Thanks for all your input, I think I have now an implementation that >> works on Tomcat and Jetty. >> >> By testing it, I've found something that can be an interesting >> information for you. >> >> The

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-25 Thread Yann Simon
2014-03-20 15:28 GMT+01:00 Yann Simon : > Thanks for all your input, I think I have now an implementation that > works on Tomcat and Jetty. > > By testing it, I've found something that can be an interesting > information for you. > > The upload variant with forking a new thread is very very slow. >

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-20 Thread Yann Simon
Thanks for all your input, I think I have now an implementation that works on Tomcat and Jetty. By testing it, I've found something that can be an interesting information for you. The upload variant with forking a new thread is very very slow. My non scientific tests by uploading a file from 1.4

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-20 Thread Yann Simon
One option I am trying is to ignore onAllDataRead and to use sevletInputStream.isFinished to know when the body is totally consumed: https://github.com/yanns/servlet31_async/blob/master/src/main/java/com/yann/ReadListenerImpl.java#L55 Is it a dumb idea? 2014-03-20 7:42 GMT+01:00 Yann Simon : > T

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-19 Thread Yann Simon
Thanks Rémy and Mark for the quick feedback and explanations! On Mar 19, 2014 6:40 PM, "Mark Thomas" wrote: > On 19/03/2014 17:04, Rémy Maucherat wrote: > > 2014-03-19 17:47 GMT+01:00 Yann Simon : > > > >>> This is because you're forking a thread, it won't concurrently invoke > the > >>> two even

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-19 Thread Mark Thomas
On 19/03/2014 17:04, Rémy Maucherat wrote: > 2014-03-19 17:47 GMT+01:00 Yann Simon : > >>> This is because you're forking a thread, it won't concurrently invoke the >>> two events (which would be invalid). >> >> Can you explain more please? I have difficulties to understand your >> sentence. >> >

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-19 Thread Yann Simon
2014-03-19 17:24 GMT+01:00 Rémy Maucherat : > 2014-03-19 17:10 GMT+01:00 Yann Simon : > >> 2014-03-19 17:05 GMT+01:00 Rémy Maucherat : >> > 2014-03-19 16:36 GMT+01:00 Yann Simon : >> > >> >> I have maybe found another problem: >> >> onAllDataRead is called with the same thread that is calling input

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-19 Thread Rémy Maucherat
2014-03-19 17:47 GMT+01:00 Yann Simon : > > This is because you're forking a thread, it won't concurrently invoke the > > two events (which would be invalid). > > Can you explain more please? I have difficulties to understand your > sentence. > It means the container has to wait until onReadPossi

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-19 Thread Rémy Maucherat
2014-03-19 17:10 GMT+01:00 Yann Simon : > 2014-03-19 17:05 GMT+01:00 Rémy Maucherat : > > 2014-03-19 16:36 GMT+01:00 Yann Simon : > > > >> I have maybe found another problem: > >> onAllDataRead is called with the same thread that is calling input.read. > >> > > > > I am not aware of any requiremen

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-19 Thread Rémy Maucherat
2014-03-19 16:36 GMT+01:00 Yann Simon : > I have maybe found another problem: > onAllDataRead is called with the same thread that is calling input.read. > I am not aware of any requirement that says this is not allowed. Rémy

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-19 Thread Yann Simon
2014-03-19 17:05 GMT+01:00 Rémy Maucherat : > 2014-03-19 16:36 GMT+01:00 Yann Simon : > >> I have maybe found another problem: >> onAllDataRead is called with the same thread that is calling input.read. >> > > I am not aware of any requirement that says this is not allowed. > > Rémy You're right,

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-19 Thread Mark Thomas
On 19/03/2014 15:36, Yann Simon wrote: > Hi, > > I have maybe found another problem: > onAllDataRead is called with the same thread that is calling input.read. > > I updated the sample to show the problem: > https://github.com/yanns/servlet31_async/commit/3c7618a51a8efd76956a6a29e27f350f7dbe835b

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-19 Thread Yann Simon
2014-03-19 16:42 GMT+01:00 Mark Thomas : > On 19/03/2014 15:36, Yann Simon wrote: >> Hi, >> >> I have maybe found another problem: >> onAllDataRead is called with the same thread that is calling input.read. >> >> I updated the sample to show the problem: >> https://github.com/yanns/servlet31_async/

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-03-19 Thread Yann Simon
Hi, I have maybe found another problem: onAllDataRead is called with the same thread that is calling input.read. I updated the sample to show the problem: https://github.com/yanns/servlet31_async/commit/3c7618a51a8efd76956a6a29e27f350f7dbe835b The servlet displays a wrong size of the uploaded fi

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-02-01 Thread Yann Simon
On Jan 31, 2014 7:36 PM, "Mark Thomas" wrote: > > On 31/01/2014 11:52, Yann Simon wrote: > > On Jan 31, 2014 10:25 AM, "Mark Thomas" wrote: > >> > >> On 31/01/2014 07:58, Yann Simon wrote: > >> On Jan 30, 2014, at 11:18 AM, Yann Simon > >> > >>> Jetty seems to allow this. Why not tomcat? Is

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-31 Thread Mark Thomas
On 31/01/2014 11:52, Yann Simon wrote: > On Jan 31, 2014 10:25 AM, "Mark Thomas" wrote: >> >> On 31/01/2014 07:58, Yann Simon wrote: >> On Jan 30, 2014, at 11:18 AM, Yann Simon >> >>> Jetty seems to allow this. Why not tomcat? Is there something in the >>> specification about it. I could not

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-31 Thread Yann Simon
On Jan 31, 2014 10:25 AM, "Mark Thomas" wrote: > > On 31/01/2014 07:58, Yann Simon wrote: > On Jan 30, 2014, at 11:18 AM, Yann Simon > > > Jetty seems to allow this. Why not tomcat? Is there something in the > > specification about it. I could not find anything explicit. > > It could simply

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-31 Thread Mark Thomas
On 31/01/2014 07:58, Yann Simon wrote: On Jan 30, 2014, at 11:18 AM, Yann Simon > I wrote a sample app to demonstrate the problem: > https://github.com/yanns/servlet31_async Thanks for the sample. That always makes looking at these things a lot easier. > Maybe it is too simplified

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-30 Thread Yann Simon
On Jan 30, 2014 11:02 PM, "Daniel Mikusa" wrote: > > On Jan 30, 2014, at 3:38 PM, Yann Simon wrote: > > > 2014-01-30 Daniel Mikusa : > >> On Jan 30, 2014, at 11:18 AM, Yann Simon wrote: > >> > >>> Hi, > >>> > >>> I wrote a sample app to demonstrate the problem: > >>> https://github.com/yanns/ser

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-30 Thread Daniel Mikusa
On Jan 30, 2014, at 3:38 PM, Yann Simon wrote: > 2014-01-30 Daniel Mikusa : >> On Jan 30, 2014, at 11:18 AM, Yann Simon wrote: >> >>> Hi, >>> >>> I wrote a sample app to demonstrate the problem: >>> https://github.com/yanns/servlet31_async >>> >>> You can generate an exploded war with maven:

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-30 Thread Yann Simon
2014-01-30 Daniel Mikusa : > On Jan 30, 2014, at 11:18 AM, Yann Simon wrote: > >> 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

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-30 Thread Rémy Maucherat
2014-01-30 Yann Simon : > It means we cannot write real asynchronous reactive applications with > servlet 3.1... disappointing. > > onDataAvailable is already something asynchronous, so starting an asynchronous operation from it to do the same thing you're supposed to do is not going to make thing

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-30 Thread Daniel Mikusa
On Jan 30, 2014, at 11:18 AM, Yann Simon wrote: > 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

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-30 Thread Yann Simon
2014-01-30 Rémy Maucherat : > 2014-01-30 Yann Simon : > >> 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 uploa

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-30 Thread Rémy Maucherat
2014-01-30 Yann Simon : > 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

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-30 Thread Yann Simon
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 w

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-08 Thread Yann Simon
2014/1/8 Daniel Mikusa : > On Jan 8, 2014, at 12:04 PM, Yann Simon wrote: > >> Hi, >> >> I am trying to write a servlet that asynchronously read data from the >> servlet request input stream. >> I tested my servlet with tomcat 8.0.0-RC5. > > If possible, you might want to try 8.0.0-RC10 or trunk a

Re: Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-08 Thread Daniel Mikusa
On Jan 8, 2014, at 12:04 PM, Yann Simon wrote: > Hi, > > I am trying to write a servlet that asynchronously read data from the > servlet request input stream. > I tested my servlet with tomcat 8.0.0-RC5. If possible, you might want to try 8.0.0-RC10 or trunk and see if you're getting the same

Tomcat 8.0.0-RC5: asynchron IO and back pressure with ReadListener

2014-01-08 Thread Yann Simon
Hi, I am trying to write a servlet that asynchronously read data from the servlet request input stream. I tested my servlet with tomcat 8.0.0-RC5. the symptoms: - I must synchronously read the input stream in onDataAvailable() so that the upload works what I expected: I want to be more "reactive