sshmendez opened a new pull request, #3705:
URL: https://github.com/apache/tinkerpop/pull/3705

   Two bugs in `TinkerTransactionGraph` when a vertex index exists.
   
   **1. Indexed lookup misses a vertex modified in the current transaction**
   
   `TinkerTransactionalIndex.getNotModifiedElements` drops every element whose 
container `isChanged()`. Adding an edge touches both endpoint vertices, but 
they never enter the transaction-local index (only property writes do), so they 
disappear from the lookup until commit.
   
   ```groovy
   graph.createIndex('name', Vertex.class)
   g.addV().property('name', 'hub').iterate(); g.tx().commit()
   g.addV().addE('e').to(__.V().has('name', 'hub')).iterate()
   g.V().has('name', 'hub').count()   // 0, expected 1
   ```
   
   Fix: keep a changed element if its current value still holds the indexed 
key/value.
   
   **2. `NullPointerException` on rollback with a vertex index but no edge 
index**
   
   `TinkerTransaction.doRollback` checks `vertexIndex` before calling 
`edgeIndex.rollback()`. The NPE skips the rest of the cleanup, so the thread's 
transaction is never closed. Under Gremlin Server this leaves a worker thread 
whose later requests never get a response.
   
   Fix: check `edgeIndex`.
   
   Tests for both are in `TinkerTransactionGraphTest`; they fail before the 
fix. The full `tinkergraph-gremlin` suite passes.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to