Skip to content

docs: document fork-safety limitation for gRPC channels#111

Merged
zeevdr merged 1 commit into
mainfrom
docs/fork-safety-warning
May 26, 2026
Merged

docs: document fork-safety limitation for gRPC channels#111
zeevdr merged 1 commit into
mainfrom
docs/fork-safety-warning

Conversation

@zeevdr
Copy link
Copy Markdown
Member

@zeevdr zeevdr commented May 26, 2026

Summary

  • gRPC channels are not fork-safe, but this was undocumented — users relying on multiprocessing or Gunicorn workers would hit silent hangs or crashes with no guidance on why or how to fix it.
  • Adds a dedicated "Fork safety" section to watching.md explaining the root cause, showing the correct pattern (create the client inside the worker), and recommending the spawn start method.
  • Adds a brief callout to README.md pointing to that section so the warning is visible without digging into the docs.

Test plan

  • Reviewed rendered Markdown for readability and correct anchor links
  • Confirmed #fork-safety anchor in watching.md matches the README link target

Closes #69

gRPC channels are not fork-safe. Forking after creating a ConfigClient
(or while a ConfigWatcher thread runs) results in undefined behavior —
the child inherits the channel's internal threads and file descriptors
in an unrecoverable state.

Adds a "Fork safety" section to watching.md with an explanation,
a multiprocessing.Pool example showing the correct pattern, and a note
on preferring the spawn start method. Adds a brief callout to README.md
linking to that section.

Co-Authored-By: Claude <noreply@anthropic.com>
Closes #69
@zeevdr zeevdr added this to the Beta Readiness milestone May 26, 2026
@zeevdr zeevdr added size: S Quick win — a few hours or less priority: P2 Nice-to-have labels May 26, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zeevdr zeevdr merged commit 8e6f1d5 into main May 26, 2026
12 checks passed
@zeevdr zeevdr deleted the docs/fork-safety-warning branch May 26, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P2 Nice-to-have size: S Quick win — a few hours or less

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document fork-safety (gRPC channel is not fork-safe)

1 participant