Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2014-09-03 23:30:21 +0000
committerGreg Wilkins2014-09-03 23:30:21 +0000
commit610bac49b9f9dcc0631dac674b3457216ac31755 (patch)
treef466a76c9970accfb6828a1a400a7d4388afd66f /jetty-util
parented8abd1d53261e871e384615adcfadc46aca43cf (diff)
downloadorg.eclipse.jetty.project-610bac49b9f9dcc0631dac674b3457216ac31755.tar.gz
org.eclipse.jetty.project-610bac49b9f9dcc0631dac674b3457216ac31755.tar.xz
org.eclipse.jetty.project-610bac49b9f9dcc0631dac674b3457216ac31755.zip
435322 Added a idleTimeout to the SharedBlockerCallback
Diffstat (limited to 'jetty-util')
-rw-r--r--jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java20
1 files changed, 6 insertions, 14 deletions
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java b/jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java
index 168a19d8b8..1c4ff3404d 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java
@@ -104,7 +104,8 @@ public class SharedBlockingCallback
{
if (idle>0)
{
- if (!_idle.await(idle,TimeUnit.MILLISECONDS))
+ // Wait a little bit longer than the blocker might block
+ if (!_idle.await(idle*2,TimeUnit.MILLISECONDS))
throw new IOException(new TimeoutException());
}
else
@@ -114,12 +115,7 @@ public class SharedBlockingCallback
}
catch (final InterruptedException e)
{
- throw new InterruptedIOException()
- {
- {
- initCause(e);
- }
- };
+ throw new InterruptedIOException();
}
finally
{
@@ -213,7 +209,8 @@ public class SharedBlockingCallback
{
if (idle>0)
{
- if (!_complete.await(idle,TimeUnit.MILLISECONDS))
+ // Wait a little bit longer than expected callback idle timeout
+ if (!_complete.await(idle+idle/2,TimeUnit.MILLISECONDS))
// The callback has not arrived in sufficient time.
// We will synthesize a TimeoutException
_state=new BlockerTimeoutException();
@@ -238,12 +235,7 @@ public class SharedBlockingCallback
}
catch (final InterruptedException e)
{
- throw new InterruptedIOException()
- {
- {
- initCause(e);
- }
- };
+ throw new InterruptedIOException();
}
finally
{

Back to the top