I’ve been working with Jetty’s Continuations API and just figured out a very frustrating bug (* at least I think this was the reason*).
If I had read more closely, I would have seen this:
The timeout should be set before the suspend, by a call to
continuation.setTimeout(long); if no timeout is set, then the default
period is used.
So in my code, I was simply suspending a continuation without setting a timeout. When I read this in the documentation…
A timeout of <=0 means the continuation will never expire.
… and then tried setting the timeout to something negative, things started working (* at least it seems so *).
Unfortunately, I haven’t been able to figure out what the “default period” is for a timeout. Where can I find this out?
I guess I figured this out while stepping through the debugger… the default time period is 30 seconds. I found the source code…
http://www.jarvana.com/jarvana/view/org/eclipse/jetty/aggregate/jetty-all/8.0.4.v20111024/jetty-all-8.0.4.v20111024-sources.jar!/org/eclipse/jetty/continuation/FauxContinuation.java?format=ok
… and it seems like this
FauxContinuationimplementation of aContinuationwas being constructed and the timeout is initialized to 30 seconds.