Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 7.4.5, 7.5.0
-
Fix Version/s: None
-
Component/s: Client
-
Labels:None
-
Environment:Hidejava version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.9) (fedora-54.1.9.9.fc14-i386)
OpenJDK Server VM (build 19.0-b09, mixed mode)
enabled RedirectListener
setConnectBlocking : reproduced with both "true" and "false"Showjava version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.9.9) (fedora-54.1.9.9.fc14-i386) OpenJDK Server VM (build 19.0-b09, mixed mode) enabled RedirectListener setConnectBlocking : reproduced with both "true" and "false"
-
Number of attachments :
Description
This IllegalStateException suggests, well, an invalid state transition. Not hard for me to reproduce this. It also results in no onException,onComplete being called:
On expire: java.lang.IllegalStateException: 0 => 8 at org.eclipse.jetty.client.HttpExchange.setStatus(HttpExchange.java:338) at org.eclipse.jetty.client.HttpExchange.expire(HttpExchange.java:113) at iudex.jettyhttpclient.Client$Session$Exchange.expire(Client.java:454) at org.eclipse.jetty.client.HttpExchange$1.expired(HttpExchange.java:880) at org.eclipse.jetty.util.thread.Timeout.tick(Timeout.java:133) at org.eclipse.jetty.util.thread.Timeout.tick(Timeout.java:146) at org.eclipse.jetty.client.HttpClient$1.run(HttpClient.java:457) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636)
As a partial/dubious workaround I have added this to my HttpExchange subclass:
@Override protected void expire( HttpDestination destination ) { try { super.expire( destination ); } catch( IllegalStateException x ) { _log.debug( "On expire: ", x ); onException( x ); cancel(); } }
Which at least gets me an onException() call for this case. However, I'm concerned it suggests other problems or may leave the destination in a inconsistent state?
This can only happen if the HttpExchange timed out in the destination queue before HttpExchange enters any other state.
We can easily handle this in the onExpire method by checking the state for being 0 first. Will align with gregw and/or sbordet on possible side effects.