Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] IllegalStateException in org.eclipse.jetty.server.HttpOutput#write(byte[], int, int)

Eric,
correct diagnosis!  We have already fixed this (see https://github.com/eclipse/jetty.project/issues/4461) and a new release will be coming soon.

regards


On Fri, 10 Jan 2020 at 12:45, Eric Theriault <eric@xxxxxxxxxxxxxxxxx> wrote:
Hi--



I have just upgraded to 9.4.25.v20191220 and I have a piece of code that calls org.apache.commons.io.IOUtils.copy(inputStream, outputStream), where the outputStream is an instance of HttpOutput -- this code essentially just reads the code in chunks of 4096 bytes and writes that to the outputStream.

For one stream in particular (I'm still trying to figure out what is different with it), after sending 64,428 bytes, it sets the _apiState to BLOCKED.  When the next segment is copied over, however, the _apiState is still BLOCKED and falls into the default case which throws an IllegalStateException.

I've traced through the code and in line 806, I wonder why the code does not call onWriteComplete as would happen in line 835.  Is that the bug?  Or is there something more subtle here?



Looks like this was recently changed in https://github.com/eclipse/jetty.project/pull/4409 if I understand correctly.

This is the exception for reference:

java.lang.IllegalStateException: s=OPEN,api=BLOCKED,sc=false,e=null
at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:767)~[jetty-server-9.4.25.v20191220.jar:9.4.25.v20191220]
at org.springframework.security.web.util.OnCommittedResponseWrapper$SaveContextServletOutputStream.write(OnCommittedResponseWrapper.java:639) ~[spring-security-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2315) ~[commons-io-2.6.jar:2.6]
at org.apache.commons.io.IOUtils.copy(IOUtils.java:2270) ~[commons-io-2.6.jar:2.6]
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2291) ~[commons-io-2.6.jar:2.6]
at org.apache.commons.io.IOUtils.copy(IOUtils.java:2246) ~[commons-io-2.6.jar:2.6]

Thanks for any insight.




Eric
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users


--

Back to the top