geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Shcherbakov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-537) NPE in JTA AFTER_COMPLETION command processing
Date Mon, 09 Nov 2015 22:32:11 GMT

    [ https://issues.apache.org/jira/browse/GEODE-537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14997526#comment-14997526
] 

Sergey Shcherbakov commented on GEODE-537:
------------------------------------------

Here is a pull request with a trivial fix:
https://github.com/apache/incubator-geode/pull/32

> NPE in JTA AFTER_COMPLETION command processing
> ----------------------------------------------
>
>                 Key: GEODE-537
>                 URL: https://issues.apache.org/jira/browse/GEODE-537
>             Project: Geode
>          Issue Type: Bug
>          Components: core
>            Reporter: Sergey Shcherbakov
>
> A NullPointerException is being thrown on the server side and propagated to the Gemfire
client in case when a running JTA transaction gets rolled back:
> {code}
> 2015-10-30 11:39:09.614  WARN 4623 --- [rTaskExecutor-1] com.atomikos.icatch.imp.CoordinatorImp
  : Unexpected error in afterCompletion
> java.lang.NullPointerException: null
> 	at com.gemstone.gemfire.internal.cache.tier.sockets.command.CommitCommand.writeCommitResponse(CommitCommand.java:122)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.internal.cache.tier.sockets.command.TXSynchronizationCommand$2.run(TXSynchronizationCommand.java:152)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.internal.cache.tier.sockets.command.TXSynchronizationCommand.cmdExecute(TXSynchronizationCommand.java:196)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.internal.cache.tier.sockets.BaseCommand.execute(BaseCommand.java:191)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.doNormalMsg(ServerConnection.java:796)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.doOneMessage(ServerConnection.java:923)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.run(ServerConnection.java:1168)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_05]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_05]
> 	at com.gemstone.gemfire.internal.cache.tier.sockets.AcceptorImpl$1$1.run(AcceptorImpl.java:563)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	... 1 common frames omitted
> Wrapped by: com.gemstone.gemfire.cache.client.ServerOperationException: remote server
on crake(4623:loner):56169:166154b8: While performing a remote AFTER_COMPLETION
> 	at com.gemstone.gemfire.cache.client.internal.AbstractOp.processObjResponse(AbstractOp.java:293)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.TXSynchronizationOp$Impl.processResponse(TXSynchronizationOp.java:119)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.AbstractOp.processResponse(AbstractOp.java:224)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.AbstractOp.attemptReadResponse(AbstractOp.java:175)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.AbstractOp.attempt(AbstractOp.java:378)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.ConnectionImpl.execute(ConnectionImpl.java:273)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.pooling.PooledConnection.execute(PooledConnection.java:329)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.executeWithPossibleReAuthentication(OpExecutorImpl.java:939)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.executeOnServer(OpExecutorImpl.java:379)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.executeWithServerAffinity(OpExecutorImpl.java:229)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.execute(OpExecutorImpl.java:135)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.execute(OpExecutorImpl.java:122)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.PoolImpl.execute(PoolImpl.java:712) ~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.TXSynchronizationOp.execute(TXSynchronizationOp.java:52)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.cache.client.internal.ServerRegionProxy.afterCompletion(ServerRegionProxy.java:860)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.internal.cache.tx.ClientTXStateStub.afterCompletion(ClientTXStateStub.java:213)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.gemstone.gemfire.internal.cache.TXStateProxyImpl.afterCompletion(TXStateProxyImpl.java:539)
~[gemfire-core-1.0.0-incubating-SNAPSHOT.jar:na]
> 	at com.atomikos.icatch.jta.Sync2Sync.afterCompletion(Sync2Sync.java:73) ~[transactions-jta-3.9.3.jar:na]
> 	at com.atomikos.icatch.imp.CoordinatorImp.notifySynchronizationsAfterCompletion(CoordinatorImp.java:547)
[transactions-3.9.3.jar:na]
> 	at com.atomikos.icatch.imp.CoordinatorStateHandler.rollbackWithAfterCompletionNotification(CoordinatorStateHandler.java:833)
[transactions-3.9.3.jar:na]
> 	at com.atomikos.icatch.imp.ActiveStateHandler.rollbackWithAfterCompletionNotification(ActiveStateHandler.java:49)
[transactions-3.9.3.jar:na]
> 	at com.atomikos.icatch.imp.ActiveStateHandler.rollback(ActiveStateHandler.java:314)
[transactions-3.9.3.jar:na]
> 	at com.atomikos.icatch.imp.CoordinatorImp.rollback(CoordinatorImp.java:741) [transactions-3.9.3.jar:na]
> 	at com.atomikos.icatch.imp.TransactionStateHandler.rollback(TransactionStateHandler.java:185)
[transactions-3.9.3.jar:na]
> 	at com.atomikos.icatch.imp.TransactionStateHandler.rollbackWithStateCheck(TransactionStateHandler.java:203)
[transactions-3.9.3.jar:na]
> 	at com.atomikos.icatch.imp.CompositeTransactionImp.doRollback(CompositeTransactionImp.java:237)
[transactions-3.9.3.jar:na]
> 	at com.atomikos.icatch.imp.CompositeTerminatorImp.rollback(CompositeTerminatorImp.java:123)
[transactions-3.9.3.jar:na]
> 	at com.atomikos.icatch.imp.CompositeTransactionImp.rollback(CompositeTransactionImp.java:346)
[transactions-3.9.3.jar:na]
> 	at com.atomikos.icatch.jta.TransactionImp.rollback(TransactionImp.java:217) [transactions-jta-3.9.3.jar:na]
> 	at com.atomikos.icatch.jta.TransactionManagerImp.rollback(TransactionManagerImp.java:448)
[transactions-jta-3.9.3.jar:na]
> 	at com.atomikos.icatch.jta.UserTransactionManager.rollback(UserTransactionManager.java:217)
[transactions-jta-3.9.3.jar:na]
> 	at org.springframework.transaction.jta.JtaTransactionManager.doRollback(JtaTransactionManager.java:1048)
[spring-tx-4.2.2.RELEASE.jar:4.2.2.RELEASE]
> 	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:853)
[spring-tx-4.2.2.RELEASE.jar:4.2.2.RELEASE]
> 	at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:830)
[spring-tx-4.2.2.RELEASE.jar:4.2.2.RELEASE]
> 	at org.springframework.transaction.support.TransactionTemplate.rollbackOnException(TransactionTemplate.java:164)
[spring-tx-4.2.2.RELEASE.jar:4.2.2.RELEASE]
> 	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:137)
[spring-tx-4.2.2.RELEASE.jar:4.2.2.RELEASE]
> 	at com.murex.demo.tx.publisher.SimplePublishService.publish(SimplePublishService.java:49)
[classes/:na]
> 	at com.murex.demo.tx.publisher.Publisher$PublisherTask.run(Publisher.java:55) [classes/:na]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_05]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_05]
> 	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_05]
> {code}
> The reason is that the response object in this case is not set at [this point|https://github.com/apache/incubator-geode/blob/develop/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/CommitCommand.java#L122].
> A sequence that leads to the error is following:
> <JTA Transaction Manager>.begin()
> region.put()
> <JTA Transaction Manager>.registerSynchronization(TXStateProxyImpl)
> <JTA Transaction Manager>.rollback() 
> TXStateProxyImpl.beforeCompletion()
> TXStateProxyImpl.afterCompletion()
> Im my scenario the transaction looks to roll back successfully even after NPE is thrown.
Still some parts of the relevant code might be missed in that case and could lead potentially
to other problems (e.g. [leaving hosted TX state behind|https://github.com/apache/incubator-geode/blob/develop/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/TXSynchronizationCommand.java#L153])



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message