This commit is contained in:
Matt Gilman 2015-04-08 11:28:44 -04:00
commit e456ea37f4
3 changed files with 10 additions and 4 deletions

View File

@ -130,8 +130,14 @@ public class SocketClient implements SiteToSiteClient {
return null;
}
final Transaction transaction = connectionState.getSocketClientProtocol().startTransaction(
final Transaction transaction;
try {
transaction = connectionState.getSocketClientProtocol().startTransaction(
connectionState.getPeer(), connectionState.getCodec(), direction);
} catch (final Throwable t) {
pool.terminate(connectionState);
throw t;
}
// Wrap the transaction in a new one that will return the EndpointConnectionState back to the pool whenever
// the transaction is either completed or canceled.

View File

@ -339,8 +339,8 @@ public final class StandardProcessScheduler implements ProcessScheduler {
final ProcessorLog procLog = new SimpleProcessLogger(procNode.getIdentifier(), procNode.getProcessor());
procLog.error("{} failed to invoke @OnScheduled method due to {}; processor will not be scheduled to run for {}",
new Object[]{procNode.getProcessor(), cause.getCause(), administrativeYieldDuration}, cause.getCause());
LOG.error("Failed to invoke @OnScheduled method due to {}", cause.getCause().toString(), cause.getCause());
new Object[]{procNode.getProcessor(), cause, administrativeYieldDuration}, cause);
LOG.error("Failed to invoke @OnScheduled method due to {}", cause.toString(), cause);
ReflectionUtils.quietlyInvokeMethodsWithAnnotation(OnUnscheduled.class, procNode.getProcessor(), processContext);
ReflectionUtils.quietlyInvokeMethodsWithAnnotation(OnStopped.class, procNode.getProcessor(), processContext);

View File

@ -243,7 +243,7 @@ public class SimpleProcessLogger implements ProcessorLog {
for (int i = 0; i < os.length; i++) {
modifiedArgs[i + 1] = os[i];
}
modifiedArgs[modifiedArgs.length - 1] = t.toString();
modifiedArgs[modifiedArgs.length - 1] = (t == null) ? "" : t.toString();
return modifiedArgs;
}