Skip to content

fix(celery): clear task timing state after postrun#4504

Open
diogosilva30 wants to merge 5 commits intoopen-telemetry:mainfrom
diogosilva30:fix/celery-task-start-time-leak
Open

fix(celery): clear task timing state after postrun#4504
diogosilva30 wants to merge 5 commits intoopen-telemetry:mainfrom
diogosilva30:fix/celery-task-start-time-leak

Conversation

@diogosilva30
Copy link
Copy Markdown
Contributor

@diogosilva30 diogosilva30 commented Apr 29, 2026

Description

Split out of #4439.

This PR keeps the Celery fix narrowly focused on the task_id_to_start_time lifecycle:

  • keep the timing map instance-scoped while preserving singleton state across repeated CeleryInstrumentor() calls
  • reset it when instrumenting and uninstrumenting
  • remove completed task ids in _trace_postrun
  • add regression coverage that verifies completed tasks clear the timing cache

Testing

  • uv run tox -e py311-test-instrumentation-celery -- -q

@diogosilva30 diogosilva30 marked this pull request as draft April 29, 2026 16:35
@diogosilva30 diogosilva30 marked this pull request as ready for review May 5, 2026 14:22
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.

1 participant