More debug for intermittent failures

This commit is contained in:
Greg Wilkins 2014-07-02 16:01:00 +10:00
parent 228600caf5
commit 78b03c5b8e
4 changed files with 12 additions and 10 deletions

View File

@ -705,7 +705,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
@Override
public String toString()
{
return String.format("SendCB@%x{s=%s,i=%s,cb=%s}",hashCode(),getState(),_info,_callback);
return String.format("%s[i=%s,cb=%s]",super.toString(),getState(),_info,_callback);
}
}

View File

@ -61,10 +61,15 @@ public class SPDYClientFactoryTest extends AbstractTest
session.goAway(new GoAwayInfo(5, TimeUnit.SECONDS));
// Sleep a while to allow the factory to remove the session
// since it is done asynchronously by the selector thread
TimeUnit.SECONDS.sleep(1);
for (int i=0;i<10;i++)
{
// Sleep a while to allow the factory to remove the session
// since it is done asynchronously by the selector thread
TimeUnit.SECONDS.sleep(1);
if (clientFactory.getSessions().isEmpty())
return;
}
Assert.assertTrue(clientFactory.getSessions().isEmpty());
Assert.fail(clientFactory.getSessions().toString());
}
}

View File

@ -376,7 +376,7 @@ public abstract class IteratingCallback implements Callback
default:
if (_state.compareAndSet(current, State.CLOSED))
{
onCompleteFailure(new IllegalStateException("Closed with pending callback "+current));
onCompleteFailure(new IllegalStateException("Closed with pending callback "+this));
return;
}
}

View File

@ -159,14 +159,11 @@ public class SharedBlockingCallback
{
if (_state == null)
{
// TODO remove when feedback received on 435322
if (cause==null)
LOG.warn("null failed cause (please report stack trace) ",new Throwable());
_state = cause==null?FAILED:cause;
_complete.signalAll();
}
else if (_state == IDLE)
throw new IllegalStateException("IDLE");
throw new IllegalStateException("IDLE",cause);
}
finally
{