-
Bug
-
Resolution: Done
-
Major
-
3.0.10.Final
-
None
(I'm fairly new to resteasy and async jax-rs so apologies if I've gotten this all wrong)
There appears to be a bug in the implementation of AsyncResponse.setTimeout for values of 0 or less - the javadoc says
but what actually happens is values of 0 or less cause the response to not wait.Value lower or equal to 0 causes the context to suspend indefinitely
I believe this is caused by the implementation in SynchronousExecutionContext@125 which uses syncLatch.await(long,TimeUnit) and passes in the exact values given in the AsyncResponse.setTimeout. However the intended semantics of these two methods w.r.t. <=0 values is the opposite, from the CountDownLatch docs:
If the time is less than or equal to zero, the method will not wait at all
A work around is to specify a timeout when configuring the AsyncResponse that is some distant time in the future.
- is cloned by
-
JBEAP-4695 Opposite behaviour of AsyncResponse.setTimeout with <= 0 values.
- Closed