Skip to content

fix(core): close traversal iterators on failure - #3317

Merged
imbajin merged 3 commits into
apache:masterfrom
hugegraph:fix/traverser-cursor-cleanup
Oct 12, 2026
Merged

imbajin merged 3 commits into
apache:masterfrom
hugegraph:fix/traverser-cursor-cleanup

Conversation

@imbajin

@imbajin imbajin commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

An OLTP edge consumer could leave its active iterator open after failure, early stop or interruption. A full queue could also keep its producer blocked after the worker failed, and a later transaction cleanup failure could replace the original business error.

Close the owned iterator in finally, using the original input when preparation fails. Stop failed consumer queues so blocked producers can exit, propagate a normal stop so producers stop reading inputs, retain the first terminal error, and attach later cleanup failures as suppressed exceptions. Preserve the worker transaction binding and completion cleanup from #3314 while integrating current master and both native test registrations.

Remove the global algorithm classfile exclusion from the existing JaCoCo report. The same real native execution data now reports the traversal's exercised and unexercised code; coverage thresholds and upload selection are unchanged.

Validation: deterministic before/after controls with assertions enabled, real RocksDB failure/stop/interruption/capacity regressions, bounded full-queue producer/worker tests, focused Maven consumer tests, Java 17 formatting, clean reactor compilation, and three independent final reviews passed. The original database and column families reopen with createIfMissing=false. New-head CI is pending.

The runtime contract is documented in docs/storage-lifecycle.md. This validates active iterators and the tested standard lazy BFS queue path; complete C04 and distributed acceptance remain separate. Source: the original org #295 branch. No public configuration or dependency changes.

Close the owned traversal iterator on completion, failure, early stop and interruption

- close the prepared iterator on every consumer exit
- keep the original failure and suppress closing errors
- verify real native cursor ownership after caller cleanup
@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.46%. Comparing base (6aa362a) to head (0198608).

Files with missing lines Patch % Lines
...main/java/org/apache/hugegraph/util/Consumers.java 68.29% 9 Missing and 4 partials ⚠️
...e/hugegraph/traversal/algorithm/OltpTraverser.java 89.47% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3317      +/-   ##
============================================
+ Coverage     52.42%   52.46%   +0.03%     
+ Complexity     2273     2009     -264     
============================================
  Files           762      762              
  Lines         67400    67431      +31     
  Branches       9138     9151      +13     
============================================
+ Hits          35333    35376      +43     
+ Misses        28525    28521       -4     
+ Partials       3542     3534       -8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- integrate current master and resolve test suite conflicts
- stop blocked producers when traversal workers fail
- retain the primary failure across worker cleanup
- include traversal algorithms in coverage reports
@imbajin imbajin changed the title fix(core): close stopped traversal iterators fix(core): close traversal iterators on failure Oct 12, 2026
- propagate clean consumer stop to producer loops
- retain terminal business and cleanup failures
- verify bounded lazy production with real native cursors
@imbajin
imbajin merged commit b58a77c into apache:master Oct 12, 2026
33 of 34 checks passed
@imbajin
imbajin deleted the fix/traverser-cursor-cleanup branch October 12, 2026 14:11
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.

2 participants