Skip to content

fix: preserve task and query failure causes - #3394

Merged
imbajin merged 1 commit into
apache:masterfrom
hugegraph:fix/java17-cleanup-round2
Oct 22, 2026
Merged

imbajin merged 1 commit into
apache:masterfrom
hugegraph:fix/java17-cleanup-round2

Conversation

@imbajin

@imbajin imbajin commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Purpose of the PR

Counterpart: hugegraph#330. Both PRs use the same source branch.

Builds on the lifecycle cleanup merged in ASF #3393. This diff contains the second cleanup round only.

Keep task and query failures visible to callers, while preserving existing API signatures, retry budgets, negative task-ID rules and stored data formats.

Main Changes

Trigger Before After
Interrupt a producer waiting on a full queue An input can be skipped while submission returns normally Submission fails with the interrupt retained and cleanup still runs
Concurrent ephemeral job scheduling Unsynchronized ID allocation can reuse an ID Atomic allocation preserves the existing negative range and wraparound
A PD unary call exhausts its retries A null response hides the RPC failure behind a later NPE Callers receive a PDException with the RPC method and original cause
ORDER BY fails or a converted iterator closes Sorting errors are swallowed and adapters can lose resource ownership Errors reach the query failure path; owned sources close once and close failures remain visible

Also retain causes when wrapping checked task errors and preserve scheduler failures without exception messages. Type conversion keeps stable iterator probes, direct next() calls and completion-supplier retry behavior.

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Existing consumer, traversal, scheduler, PD transport and aggregate-query lifecycle regressions pass.
  • Added regression coverage for interrupted submission, task-ID allocation, missing error messages, PD retry/error contracts, converted-iterator cleanup and ORDER BY RPC failure cleanup.

Validated with Java 17: repository formatting and full clean compile, followed by focused Server, PD and Store tests against the updated artifacts. Independent review found no remaining blocking issue. Multi-node cluster validation is not included.

Does this PR potentially affect the following parts?

  • Dependencies
  • Modify configurations
  • The public API
  • Other affects: failure reporting, cancellation and iterator cleanup
  • Nope

Documentation Status

  • Doc - TODO: required documentation is pending; complete it before merging.
  • Doc - Done: documentation is included here.
  • Doc - No Need: no user-visible documentation is affected.

Documentation: storage lifecycle contracts. No website configuration or API-reference changes are required.

Visual overview

Failure propagation and owned iterator cleanup

Failure propagation across interrupted submission, atomic task IDs, exhausted PD retries and owned iterator cleanup. Conceptual illustration; existing retry and compatibility contracts remain, and no cluster or RC acceptance is implied.

- fail interrupted submissions and allocate unique job IDs
- report exhausted PD calls with their original causes
- propagate sort failures and close conversion iterators
- cover retry and cleanup contracts with regression tests
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 56.90%. Comparing base (c2ec570) to head (e7b0405).
⚠️ Report is 14 commits behind head on master.

Files with missing lines Patch % Lines
.../apache/hugegraph/job/system/DeleteExpiredJob.java 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3394      +/-   ##
============================================
+ Coverage     55.93%   56.90%   +0.96%     
- Complexity     2277     2728     +451     
============================================
  Files           774      776       +2     
  Lines         68534    68901     +367     
  Branches       9333     9425      +92     
============================================
+ Hits          38334    39205     +871     
+ Misses        26634    26081     -553     
- Partials       3566     3615      +49     
Flag Coverage Δ *Carryforward flag
commons 96.37% <ø> (ø) Carriedforward from c2ec570
hstore 36.02% <0.00%> (+0.21%) ⬆️
pd 50.77% <100.00%> (+1.60%) ⬆️
server_hbase 41.93% <ø> (+0.03%) ⬆️ Carriedforward from c2ec570
server_memory 55.70% <90.00%> (+1.36%) ⬆️
server_rocksdb 42.71% <20.00%> (+0.36%) ⬆️
store 32.97% <0.00%> (+1.04%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

☔ 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.

@imbajin
imbajin force-pushed the fix/java17-cleanup-round2 branch from ceb2b91 to e7b0405 Compare October 22, 2026 20:23
@imbajin
imbajin marked this pull request as ready for review October 22, 2026 20:24
@imbajin
imbajin merged commit f323860 into apache:master Oct 22, 2026
18 checks passed
@imbajin
imbajin deleted the fix/java17-cleanup-round2 branch October 22, 2026 20:45
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