opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

Fix race condition in ConcurrentMultiSpanProcessor.shutdown()

Open jomcgi opened this issue 9 months ago • 2 comments

Description

Fixed error during shutdown: 'cannot schedule new futures after shutdow'. Modified shutdown sequence to handle executor already being in shutdown state. Added direct processor shutdown when executor is unavailable. Added regression test for executor shutdown race condition.

Fixes #4461

Type of change

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

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [x] tox -e test-opentelemetry-sdk

Does This PR Require a Contrib Repo Change?

  • [x] No.

Checklist:

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

jomcgi avatar Mar 06 '25 00:03 jomcgi

Check my comment on #4461 I'm not sure this fixes the problem

aabmass avatar Apr 04 '25 16:04 aabmass

I've rebased the PR onto main to resolve conflicts.

Check my comment on #4461 I'm not sure this fixes the problem

@aabmass the reproducer from #4461 generates an error in main for Python >= 3.9. I can't reproduce on this branch, it works as expected.

Do you think we should be looking at an alternative solution?

jomcgi avatar May 26 '25 13:05 jomcgi