Skip to content

fix(tools): propagate restore worker failures - #54

Closed
imbajin wants to merge 1 commit into
masterfrom
fix/integration-tools-errors
Closed

imbajin wants to merge 1 commit into
masterfrom
fix/integration-tools-errors

Conversation

@imbajin

@imbajin imbajin commented Oct 9, 2026 •

Copy link
Copy Markdown

Purpose of the PR

A restore worker could fail while reading a damaged JSON/ZIP file or inserting records, yet the command would report success and clean its input directory. Worker failures now reach the existing CLI error path after all submitted work finishes, and failed restores retain their inputs.

Found in the Toolchain integration report.

tools restore: before and after

Main Changes

  • Propagate restore worker failures through their Futures.
  • Drain all tasks before reporting the first failure and retaining later failures as suppressed exceptions.
  • Preserve interruption through cleanup and cover damaged input, rejected writes, failure cleanup and valid empty backups. No new backup format or missing-file inference is added.

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests.
  • Need tests and can be verified as follows:
    • Targeted Java 17 Maven tests pass with actual corrupt JSON/ZIP files, asynchronous failures and interruption. The original production classes fail the corresponding negative controls.
    • The legitimate empty backup remains valid; clean=true retains input after a failed restore.
    • Checkstyle and three independent read-only reviews passed.
    • Original and fixed native CLI packages pass the paired real Server acceptance: damaged JSON/ZIP returns success and deletes inputs before the fix, versus Unix exit 255 and retained input hashes after it. Legal empty backup/restore still succeeds; full functional regressions and upstream core CI pass.

Does this PR potentially affect the following parts?

  • Nope
  • Dependencies
  • Modify configurations
  • The public API
  • Other affects

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need: restores the existing CLI failure and cleanup contract.

Organization and upstream core CI pass. Original and fixed native packages use the same verified Server SDK and fixture; task-owned graphs and services are cleaned up after acceptance.

The native CLI checks answer n to its existing optional stack-trace prompt before verifying the Unix error exit; this PR preserves that prompt contract.

- drain asynchronous tasks before reporting failures
- preserve suppressed errors and interrupt state
- retain backup input when restore fails
- cover corrupt input and valid empty backups
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T20:21:35.695138Z b37c8da PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the tools label Oct 9, 2026
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 00050f85-43d4-4119-afb2-ac10ba79c6d5

📥 Commits

Reviewing files that changed from the base of the PR and between e669922 and b37c8da.


📒 Files selected for processing (5)
  • hugegraph-tools/src/main/java/org/apache/hugegraph/base/RetryManager.java
  • hugegraph-tools/src/main/java/org/apache/hugegraph/manager/RestoreManager.java
  • hugegraph-tools/src/test/java/org/apache/hugegraph/test/functional/FuncTestSuite.java
  • hugegraph-tools/src/test/java/org/apache/hugegraph/test/functional/RestoreFailureTest.java
  • hugegraph-tools/src/test/java/org/apache/hugegraph/test/functional/RetryManagerTest.java


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@imbajin imbajin closed this Oct 10, 2026
@imbajin
imbajin deleted the fix/integration-tools-errors branch October 10, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant