]
Kabir Khan updated WFCORE-1016:
-------------------------------
Fix Version/s: 2.0.0.CR7
(was: 2.0.0.CR6)
NPE or AssertionError if op is cancelled on slave between sending
prepare and receiving commit/rollback
-------------------------------------------------------------------------------------------------------
Key: WFCORE-1016
URL:
https://issues.jboss.org/browse/WFCORE-1016
Project: WildFly Core
Issue Type: Bug
Components: Domain Management
Affects Versions: 2.0.0.CR5
Reporter: Brian Stansberry
Assignee: Brian Stansberry
Fix For: 2.0.0.CR7
OperationCancellationTestCase showed this failure:
{code}
2015-09-23 06:43:40,147 INFO
[org.jboss.as.test.integration.management.extension.blocker.BlockerExtension] (Host
Controller Service Threads - 82) block requested by testSlaveBlockCompletionCancelSlave
for slave/undefined(COMMIT)
2015-09-23 06:43:40,147 INFO
[org.jboss.as.test.integration.management.extension.blocker.BlockerExtension] (Host
Controller Service Threads - 82) will block at COMMIT for 20000
2015-09-23 06:43:40,164 INFO [org.jboss.as.controller.management-operation] (Host
Controller Service Threads - 71) WFLYCTL0352: Cancelling operation 'block' with id
'1900489784' running on thread 'Host Controller Service Threads - 82'
2015-09-23 06:43:40,185 ERROR [stderr] (Host Controller Service Threads - 82) Exception
in thread "Host Controller Service Threads - 82" java.lang.AssertionError
2015-09-23 06:43:40,185 ERROR [stderr] (Host Controller Service Threads - 82) at
org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestContext.completed(TransactionalProtocolOperationHandler.java:475)
2015-09-23 06:43:40,186 ERROR [stderr] (Host Controller Service Threads - 82) at
org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.doExecute(TransactionalProtocolOperationHandler.java:190)
2015-09-23 06:43:40,186 ERROR [stderr] (Host Controller Service Threads - 82) at
org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$1.run(TransactionalProtocolOperationHandler.java:136)
2015-09-23 06:43:40,186 ERROR [stderr] (Host Controller Service Threads - 82) at
org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$1.run(TransactionalProtocolOperationHandler.java:132)
2015-09-23 06:43:40,186 ERROR [stderr] (Host Controller Service Threads - 82) at
java.security.AccessController.doPrivileged(Native Method)
2015-09-23 06:43:40,186 ERROR [stderr] (Host Controller Service Threads - 82) at
javax.security.auth.Subject.doAs(Subject.java:360)
2015-09-23 06:43:40,186 ERROR [stderr] (Host Controller Service Threads - 82) at
org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:81)
2015-09-23 06:43:40,186 ERROR [stderr] (Host Controller Service Threads - 82) at
org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$2$1.run(TransactionalProtocolOperationHandler.java:152)
2015-09-23 06:43:40,186 ERROR [stderr] (Host Controller Service Threads - 82) at
org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$2$1.run(TransactionalProtocolOperationHandler.java:148)
2015-09-23 06:43:40,187 ERROR [stderr] (Host Controller Service Threads - 82) at
java.security.AccessController.doPrivileged(Native Method)
2015-09-23 06:43:40,187 ERROR [stderr] (Host Controller Service Threads - 82) at
org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler$2.execute(TransactionalProtocolOperationHandler.java:148)
2015-09-23 06:43:40,187 ERROR [stderr] (Host Controller Service Threads - 82) at
org.jboss.as.protocol.mgmt.AbstractMessageHandler$2$1.doExecute(AbstractMessageHandler.java:299)
2015-09-23 06:43:40,187 ERROR [stderr] (Host Controller Service Threads - 82) at
org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:519)
2015-09-23 06:43:40,187 ERROR [stderr] (Host Controller Service Threads - 82) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
2015-09-23 06:43:40,187 ERROR [stderr] (Host Controller Service Threads - 82) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
2015-09-23 06:43:40,187 ERROR [stderr] (Host Controller Service Threads - 82) at
java.lang.Thread.run(Thread.java:745)
2015-09-23 06:43:40,187 ERROR [stderr] (Host Controller Service Threads - 82) at
org.jboss.threads.JBossThread.run(JBossThread.java:320)
{code}
What happens here is the slave HC executing the 'block' op has sent a prepare
message to the master, and then when the commit has not come back yet the test driver
triggers a cancel on the slave. At this point the thread running the 'block' op
returns and tries to send the final result to the master. But it fails because the prepare
logic has nulled out the responseChannel field, and the commit message has not arrived yet
to restore a new one.
If assertions weren't enabled, the result would be an NPE when the null
responseChannel is used.
I don't see any reason for null out the responseChannel.