Skip to content

Fix duplicate Pyramid traversal subscribers#4741

Open
sjh9714 wants to merge 1 commit into
open-telemetry:mainfrom
sjh9714:fix-pyramid-duplicate-before-traversal
Open

Fix duplicate Pyramid traversal subscribers#4741
sjh9714 wants to merge 1 commit into
open-telemetry:mainfrom
sjh9714:fix-pyramid-duplicate-before-traversal

Conversation

@sjh9714

@sjh9714 sjh9714 commented Jun 25, 2026

Copy link
Copy Markdown

Description

Fixes #4663.

opentelemetry-instrumentation-pyramid can register duplicate _before_traversal subscribers when a Pyramid include calls config.commit() and a later include creates another child configurator. This change records that the callbacks have already been registered in Pyramid settings, so later includes re-enable tracing without adding a duplicate subscriber or tween.

Type of change

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

How Has This Been Tested?

  • uvx --from tox --with tox-uv tox -e py314-test-instrumentation-pyramid
  • uvx --from tox --with tox-uv tox -e lint-instrumentation-pyramid
  • uvx --from tox --with tox-uv tox -e ruff

Does This PR Require a Core Repo Change?

  • No.

Checklist:

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

@sjh9714 sjh9714 requested a review from a team as a code owner June 25, 2026 15:23
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 25, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: sjh9714 / name: sjh9714 (035853c)

Register Pyramid traversal callbacks only once per configurator settings so a commit during include processing does not allow later includes to add duplicate subscribers.

Assisted-by: OpenAI Codex
@sjh9714 sjh9714 force-pushed the fix-pyramid-duplicate-before-traversal branch from c9112a4 to 035853c Compare June 25, 2026 15:24
@sjh9714

sjh9714 commented Jun 26, 2026

Copy link
Copy Markdown
Author

/easycla

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

opentelemetry-instrumentation-pyramid double BeforeTraversal subscriber registration after config.commit()

1 participant