Cole-Greer opened a new pull request, #2992: URL: https://github.com/apache/tinkerpop/pull/2992
This is based on a [reported issue in discord](https://discord.com/channels/838910279550238720/1260355937604997240/1332331746418491475) where users were observing a `TransactionException` due to concurrent modification in an unexpected case. The test added in this case is a simplified reproducer for the reported issue. The root cause of the issue is that a read only traversal will increment an elements [usedInTransactions](https://github.com/apache/tinkerpop/blob/077e3eb22c463545c3fc974944d4bf1d5d6a32fd/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerElementContainer.java#L65) count as the read operation must call [getWithClone()](https://github.com/apache/tinkerpop/blob/077e3eb22c463545c3fc974944d4bf1d5d6a32fd/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerElementContainer.java#L90), however in 3.7.3, the `usedInTransactions` counter is never decremented for read-only elements when the transaction is committed. In the example used in the test in this PR, vertex 1 will have an incorrect `usedInTransactions` of 1 after the read-only transaction has been committed. This causes the subsequent "delete" query not to remove the vertex from the graph as it is still "in use". This then leads to a TransactionException due to concurrent modification when the final query attempts to create a new vertex with the same ID. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
