Skip to content

Conversation

@cretz
Copy link
Member

@cretz cretz commented Jul 21, 2025

What was changed

  • Add Rust code to track PID runtime was created on
  • Add Rust checks to client create, client RPC call, worker create, and worker poll start to ensure same PID as runtime
  • Added README clarifications

Checklist

  1. Closes [Feature Request] Investigate, document, and validate fork behavior #273

@cretz cretz requested a review from a team as a code owner July 21, 2025 22:43
Comment on lines 86 to 92
if runtime.handle.pid != std::process::id() {
return Err(error!(
"Cannot create clients across forks (original runtime PID is {}, current is {})",
runtime.handle.pid,
std::process::id()
));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just lift all four of these out to a fork_check(reason: &'static str)

@cretz cretz merged commit 5be2e52 into temporalio:main Jul 23, 2025
8 checks passed
@cretz cretz deleted the prevent-fork branch July 23, 2025 18:37
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.

[Feature Request] Investigate, document, and validate fork behavior

2 participants