Customize SharedMemoryManager subprocess start mode#520
Merged
Conversation
evanh
approved these changes
Feb 18, 2026
markstory
approved these changes
Feb 18, 2026
fpacifici
added a commit
to getsentry/sentry
that referenced
this pull request
Feb 18, 2026
Support getsentry/arroyo#520. We single node multi process conwsumer hanging at times while the SharedMemoryManager starts. It seems the subprocess created by the SharedMemoryManager crashes due to a race condition in the datadog integration. See the PR above for reference. This allows us to configure consumers to use 'spawn' start mode rather than 'fork' --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
JonasBa
pushed a commit
to getsentry/sentry
that referenced
this pull request
Feb 19, 2026
Support getsentry/arroyo#520. We single node multi process conwsumer hanging at times while the SharedMemoryManager starts. It seems the subprocess created by the SharedMemoryManager crashes due to a race condition in the datadog integration. See the PR above for reference. This allows us to configure consumers to use 'spawn' start mode rather than 'fork' --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
mchen-sentry
pushed a commit
to getsentry/sentry
that referenced
this pull request
Feb 24, 2026
Support getsentry/arroyo#520. We single node multi process conwsumer hanging at times while the SharedMemoryManager starts. It seems the subprocess created by the SharedMemoryManager crashes due to a race condition in the datadog integration. See the PR above for reference. This allows us to configure consumers to use 'spawn' start mode rather than 'fork' --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have encountered scenarios where the SharedMemoryManager subprocess crashes right after the start.
The SharedMemoryManager needs a subprocess to manage the pool.
When it starts it forks the process and waits to hear from it.
We saw this process hanging:
This seems to be caused by the process crashing:
There seems to be a race condition in the way the datadog agent maanges instances.
If, during the post_fork call, the set of instances changes (subprocess instantiating the sdk) this error can happen.
This PR attempts a fix by allowing us to make SharedMemoryManager initialize its process
by spawning the new interpreter rather than relying on fork. In this scenario we should
not have interactions between different sets of datadog integrations.