Issue #354 (Spin loop in case of exception thrown during accept()).
Improved the solution by sleeping only if we are still accepting. This avoids the sleep when the connector is stopping, speeding up tests.
This commit is contained in:
parent
79e5c31029
commit
ff1bfa599f
|
@ -536,22 +536,22 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co
|
|||
LOG.warn(current);
|
||||
else
|
||||
LOG.debug(current);
|
||||
try
|
||||
{
|
||||
// Arbitrary sleep to avoid spin looping.
|
||||
// Subclasses may decide for a different
|
||||
// sleep policy or closing the connector.
|
||||
Thread.sleep(1000);
|
||||
return true;
|
||||
}
|
||||
catch (Throwable x)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG.ignore(current);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// Arbitrary sleep to avoid spin looping.
|
||||
// Subclasses may decide for a different
|
||||
// sleep policy or closing the connector.
|
||||
Thread.sleep(1000);
|
||||
return true;
|
||||
}
|
||||
catch (Throwable x)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue