atomikos / transactions-essentials

Development repository for next major release of
https://www.atomikos.com/Main/TransactionsEssentials
Other
461 stars 139 forks source link

java.util.ConcurrentModificationException on close session with debug trace log level enabled #179

Open alexgeta opened 1 year ago

alexgeta commented 1 year ago

Hello, I have faced an issue in Atomikos 5.0.9, for me it looks like a bug. It happens after the transaction timed out and trace log level enabled. As i have seen, the problem happens in notifySessionClosed method, during iteration over allContexts collection, method toString invoked(if trace log level enabled) on line number 113 class SessionHandleState, which in turn invoked method isTerminated, and inside the last one method, collection allContexts has been modified on line number 74 which caused ConcurrentModificationException. Here is stack trace:

nested java.util.ConcurrentModificationException: null at java.util.HashMap$HashIterator.nextNode(HashMap.java:1456) at java.util.HashMap$KeyIterator.next(HashMap.java:1480) at com.atomikos.datasource.xa.session.SessionHandleState.notifySessionClosed(SessionHandleState.java:112) at com.atomikos.jdbc.internal.AtomikosJdbcConnectionProxy.close(AtomikosJdbcConnectionProxy.java:117) at sun.reflect.GeneratedMethodAccessor360.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:508) at com.atomikos.util.DynamicProxySupport.callProxiedMethod(DynamicProxySupport.java:159) at com.atomikos.util.DynamicProxySupport.invoke(DynamicProxySupport.java:116) at com.sun.proxy.$Proxy98.close(Unknown Source)

GuyPardon commented 1 year ago

Thanks, we'll check.

This will be for the 6.0 release, BTW