Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make ConcurrentMultiSpanProcessor fork safe#4862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
gregoiredx wants to merge1 commit intoopen-telemetry:main
base:main
Choose a base branch
Loading
fromgregoiredx:fork-safe-concurrent-multi-span-processor

Conversation

@gregoiredx
Copy link

@gregoiredxgregoiredx commentedDec 17, 2025
edited
Loading

Description

ConcurrentMultiSpanProcessor is not "fork safe". This MR tries to solve this problem.

Forking a threaded process is not a good idea in the first place, citing the Python doc, seehttps://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods

Note that safely forking a multithreaded process is problematic.

Also, the OTel Python SDK suggest to only initialize the SDK post fork, seehttps://opentelemetry-python.readthedocs.io/en/latest/examples/fork-process-model/README.html

Nevertheless, on an existing code base, it's not always easy to avoid all forks. So it looks like a good idea to try and make the SDK as fork safe as possible.

Note:BatchProcessor is already relying onregister_at_fork used here, see

os.register_at_fork(after_in_child=lambda:weak_reinit()())# pyright: ignore[reportOptionalCall] pylint: disable=unnecessary-lambda

Fixes#2349

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

It's quite hard to unit test.

An equivalent patch is currently running in our stack.

Does This PR Require a Contrib Repo Change?

?

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

dkmiller reacted with hooray emoji
@linux-foundation-easycla
Copy link

linux-foundation-easyclabot commentedDec 17, 2025
edited
Loading

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: gregoiredx / name: Grégoire Deveaux (f98d672)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

ConcurrentMultiSpanProcessor threadpool should be reset after process forked

1 participant

@gregoiredx

[8]ページ先頭

©2009-2025 Movatter.jp