Skip to content

fix: clean up orphaned childWorkflowComplete entries on start failure [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH] - #2268

Closed
waterWang wants to merge 2 commits into
temporalio:mainfrom
waterWang:main
Closed

waterWang wants to merge 2 commits into
temporalio:mainfrom
waterWang:main

Conversation

@waterWang

Copy link
Copy Markdown

Description

When resolveChildWorkflowExecutionStart receives a failed or cancelled result, the childWorkflowComplete completion map still holds an entry for that sequence number. Since the child workflow never started, it will never complete, so this entry is orphaned and constitutes a memory leak for the duration of the workflow execution.

Fix

Added this.completions.childWorkflowComplete.delete(getSeq(activation)) in both the activation.failed and activation.cancelled branches of resolveChildWorkflowExecutionStart to clean up the orphaned completion entry.

Testing

  • Verified the fix compiles and is logically consistent with the existing code pattern
  • The consumeCompletion method on line 721 already consumes the childWorkflowStart entry; the missing piece was cleaning up the corresponding childWorkflowComplete entry that was registered in workflow.ts line 476

Fixes #2000

When resolveChildWorkflowExecutionStart receives a failed or cancelled
result, the childWorkflowComplete completion map still holds an entry
for that sequence number. Since the child workflow never started, it
will never complete, so this entry is orphaned and constitutes a memory
leak for the duration of the workflow execution.

Fix: delete the corresponding childWorkflowComplete entry when the
start fails or is cancelled.

Fixes temporalio#2000

[FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]
@waterWang
waterWang requested a review from a team as a code owner July 28, 2026 18:37
@CLAassistant

CLAassistant commented Jul 28, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ THardy98
❌ waterWang


waterWang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@THardy98

Copy link
Copy Markdown
Contributor

Closed in favour of: #2036

@THardy98 THardy98 closed this Jul 30, 2026
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.

[Bug] Orphaned childWorkflowComplete entries on start failure

3 participants