Author: david.lloyd(a)jboss.com
Date: 2008-07-21 14:36:32 -0400 (Mon, 21 Jul 2008)
New Revision: 4421
Modified:
remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/protocol/basic/BasicHandler.java
Log:
Run handlers in separate thread to prevent a deadlock
Modified:
remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/protocol/basic/BasicHandler.java
===================================================================
---
remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/protocol/basic/BasicHandler.java 2008-07-21
18:36:10 UTC (rev 4420)
+++
remoting3/trunk/protocol/basic/src/main/java/org/jboss/cx/remoting/protocol/basic/BasicHandler.java 2008-07-21
18:36:32 UTC (rev 4421)
@@ -679,14 +679,22 @@
registerWriter(channel, new SimpleWriteHandler(allocator,
bufferList));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
- SpiUtils.safeHandleCancellation(handler);
+ executor.execute(new Runnable() {
+ public void run() {
+ SpiUtils.safeHandleCancellation(handler);
+ }
+ });
return SpiUtils.getBlankRemoteRequestContext();
}
log.trace("Sent request %s", request);
return new RemoteRequestContextImpl(id, allocator, channel);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
log.trace(t, "receiveRequest failed with an exception");
- SpiUtils.safeHandleException(handler, "Failed to build
request", t);
+ executor.execute(new Runnable() {
+ public void run() {
+ SpiUtils.safeHandleException(handler, "Failed to build
request", t);
+ }
+ });
return SpiUtils.getBlankRemoteRequestContext();
}
}
Show replies by date