Skip to content

ATLAS-4766: java.lang.IllegalStateException from JanuGraph while purg…#682

Open
sheetalshah1007 wants to merge 1 commit into
apache:masterfrom
sheetalshah1007:ATLAS-4766
Open

ATLAS-4766: java.lang.IllegalStateException from JanuGraph while purg…#682
sheetalshah1007 wants to merge 1 commit into
apache:masterfrom
sheetalshah1007:ATLAS-4766

Conversation

@sheetalshah1007

@sheetalshah1007 sheetalshah1007 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

…ing entities at Atlas

What changes were proposed in this pull request?

Problem: DeleteHandlerV1 throws java.lang.IllegalStateException when purging entities because it tries to access graph vertices/edges that have already been removed in the same transaction during batch operations.

Solution:

  1. isRelationshipEdge() method - Wrapped vertex type retrieval in try-catch to gracefully handle IllegalStateException when vertices are already removed
  2. deleteVertex() method - Added edge.exists() and outVertex.exists() checks to skip edges with removed endpoints; wrapped loop in try-catch for resilience

How was this patch tested?

New test suite DeleteHandlerV1Test.java:

  • testIsRelationshipEdgeWithPurgedEndpoint() - Verifies method handles purged endpoints safely
  • testPurgeManagerAfterSubordinateAlreadyPurged() - Tests sequential purge of related entities
  • testBatchPurgeManagerAndSubordinates() - Tests batch purge of multiple entities in one transaction

All tests confirm no IllegalStateException is thrown during delete/purge operations.

@sheetalshah1007 sheetalshah1007 force-pushed the ATLAS-4766 branch 2 times, most recently from 3bc4cb6 to d80312e Compare June 26, 2026 07:54
@chaitalicod

Copy link
Copy Markdown
Contributor

LGTM +1

@chaitalicod chaitalicod self-requested a review July 9, 2026 05:49
@sheetalshah1007

Copy link
Copy Markdown
Contributor Author

Added the attached implementation notes for ATLAS-4766. The document provides additional context on the JanusGraph IllegalStateException failure scenario, the DeleteHandlerV1 resilience changes, the dual-layer protection strategy, and the associated test coverage.
ATLAS-4766_JanusGraph_IllegalStateException_Purge_Resilience_Implementation_Notes.md

@mandarambawane mandarambawane self-requested a review July 9, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants