Skip to content

refactor(server): complete request transaction cleanup - #3302

Merged
imbajin merged 7 commits into
apache:masterfrom
hugegraph:fix/server-transaction-lifecycle
Oct 10, 2026
Merged

imbajin merged 7 commits into
apache:masterfrom
hugegraph:fix/server-transaction-lifecycle

Conversation

@imbajin

@imbajin imbajin commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Request and task cleanup releases owned graph transactions while preserving failures and worker reuse. Backend Store open and final session close share their synchronization boundary; HStore also rejects borrowers after its shared session closes.

Graph shutdown continues safe cleanup after an owner error. Ordinary task-worker failures are collected, and rollback failures retain later owner-close errors as suppressed. Pending local tasks keep their task database transaction until completion; an incomplete distributed drain no longer queues another unbounded wait on the same worker. The configured tx.close policy is preserved.

Regression tests cover multiple graphs, worker cleanup failures, rollback plus owner-close failure, closed HStore borrowing, task completion persistence and drain retry. Independent review and focused local tests passed; backend integration results are reported by the PR checks. Logical graph closure does not prove an unsuccessful native release succeeded.

image

Long-term runtime, query/Cypher and transaction contracts are consolidated in docs/server-runtime.md. Short change notes, test logs and temporary CI roadmaps were removed. This PR remains independent of the Store split and does not duplicate #3298.

- attempt every transaction owner and preserve failures
- detach failed owners before reusing worker threads
- retain caller transactions and task commit behavior
- serialize the final backend session release
- document and test transaction lifecycle boundaries
- validate shared backend availability under the pool lock
- reject sessions acquired after final backend release
- test the pool guard without backend factory checks
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 41.45299% with 137 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.37%. Comparing base (d00efce) to head (821b16b).

Files with missing lines Patch % Lines
...n/java/org/apache/hugegraph/StandardHugeGraph.java 36.84% 40 Missing and 8 partials ⚠️
...in/java/org/apache/hugegraph/task/TaskManager.java 34.48% 30 Missing and 8 partials ⚠️
...pache/hugegraph/task/DistributedTaskScheduler.java 38.09% 23 Missing and 3 partials ⚠️
...g/apache/hugegraph/task/StandardTaskScheduler.java 38.88% 17 Missing and 5 partials ⚠️
...he/hugegraph/backend/store/BackendSessionPool.java 81.81% 2 Missing ⚠️
.../apache/hugegraph/backend/tx/GraphTransaction.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3302      +/-   ##
============================================
- Coverage     41.42%   41.37%   -0.06%     
- Complexity     6931     6943      +12     
============================================
  Files           762      762              
  Lines         66773    66934     +161     
  Branches       8939     8988      +49     
============================================
+ Hits          27662    27694      +32     
- Misses        35957    36067     +110     
- Partials       3154     3173      +19     

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

- serialize store open and final session close
- verify surviving borrowers across store cleanup
- use valid task and private transaction fixtures
@imbajin imbajin changed the title fix(server): finish transaction owner cleanup fix(server): complete request transaction cleanup Oct 9, 2026
- retain owner failures while attempting later cleanup
- keep graph finalization behind transaction and task drain
- retry distributed task drain after timeouts
- cover memory owner failure and close retry boundaries
- combine query, Cypher and transaction guidance
- retain runtime configuration and compatibility limits
- remove temporary verification and CI roadmaps
- update README and build guide entry points
- collect failures inside ordinary task workers
- report all errors after worker cleanup accounting
- retain rollback errors before owner close failures
- cover both public graph close failure paths
Reject HStore borrowers after the shared session closes.
Keep pending local task persistence usable until drain.
Skip owner callbacks while scheduler close is incomplete.
Cover closed borrowing, task persistence and close retry.
@imbajin imbajin changed the title fix(server): complete request transaction cleanup refactor(server): complete request transaction cleanup Oct 10, 2026
@imbajin
imbajin merged commit 0f86e2a into apache:master Oct 10, 2026
37 of 39 checks passed
@imbajin
imbajin deleted the fix/server-transaction-lifecycle 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants