Skip to content

Resolve #4186: Drain nested Mongoose request work before transaction cleanup - #4318

Merged
ayden94 merged 6 commits into
mainfrom
issue-4186
Nov 26, 2026
Merged

ayden94 merged 6 commits into
mainfrom
issue-4186

Conversation

@ayden94

@ayden94 ayden94 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #4186.

Drain admitted Mongoose request callbacks before native rollback and keep their session available only while the transaction or relevant callback is active.

Changes

  • Track each nested request until the owning attempt settles; preserve established callback, cancellation, and cleanup ordering.
  • Use the existing session even when the parent throws synchronously before an already-admitted child starts. Do not run a pre-invocation cancelled child or admit a new boundary during drain.
  • Clarify EN/KO facade and nested callback session lifetime.

Testing

  • Exact-head focused checks and original concurrent pnpm test:node passed (1,754 passed, 0 failed, 1 skipped).

  • Same-command Vitest RED/GREEN verifies the newly fixed queued-child regression; package coverage runs manual and delegated cases.

  • Independent built-artifact probes verified first-session use, pre-invocation cancellation, blocked new boundaries, and parent error/native cleanup preservation. Historical comparisons and earlier timeouts are retained separately.

  • Exact-head review axes: contract, code, and verification. No axis omitted.

  • Full local CI was not run; the canonical remote workflow verifies the exact PR head.

Release impact

  • Consumer-visible change covered by a patch Changeset for @fluojs/mongoose.
  • No consumer-visible release impact.

Public export documentation

No public export signatures were added or changed. Existing API documentation remains applicable.

Behavioral contract

The approved transaction behavior is covered by deterministic regression tests. Existing native ownership, rollback contract, and unrelated entry points remain in scope only for preservation.

Platform consistency governance (SSOT)

Platform governance checks passed; this PR adds no new platform conformance claim.

@ayden94
ayden94 merged commit bd8572e into main Nov 26, 2026
8 checks passed
@ayden94
ayden94 deleted the issue-4186 branch November 26, 2026 11:05
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.

[mongoose] 중첩 요청 추적·세션 수명·종료 보장 복구, 실제 Promise 정산을 테스트 기준으로 사용

1 participant