Skip to content

Comments

python: properly propagate shutdown signal in weblogs#6374

Draft
florentinl wants to merge 1 commit intomainfrom
florentin.labelle/properly-forward-signals
Draft

python: properly propagate shutdown signal in weblogs#6374
florentinl wants to merge 1 commit intomainfrom
florentin.labelle/properly-forward-signals

Conversation

@florentinl
Copy link
Contributor

@florentinl florentinl commented Feb 24, 2026

Motivation

Re-enable this test: tests/test_resource_renaming.py::Test_Resource_Renaming_Stats_Aggregation_Keys::test_stats_aggregation_with_method_and_endpoint.

The main problem is that the weblog never receive the SIGTERM signal from Docker and get killed right away without having the possibility to flush their buffers on shutdown.

This PR ensures that the SIGTERM signal properly propagates to the python interpreters running the app and and can be caught by dd-trace-py.

Changes

  • Use exec to replace the shell process with the actual ddtrace-run command.
  • re-enable the test (except for uwsgi, that does not forward signals to workers)

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@github-actions
Copy link
Contributor

github-actions bot commented Feb 24, 2026

CODEOWNERS have been resolved as:

manifests/python.yml                                                    @DataDog/apm-python @DataDog/asm-python
utils/build/docker/python/django-poc.Dockerfile                         @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/python/django-py3.13.Dockerfile                      @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/python/django/app.sh                                 @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/python/docker-bake.hcl                               @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/python/fastapi.Dockerfile                            @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/python/fastapi/app.sh                                @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/python/flask-poc.Dockerfile                          @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/python/flask/app.sh                                  @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/python/python3.12.Dockerfile                         @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/python/tornado.Dockerfile                            @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/python/tornado/app.sh                                @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/python/uds-flask.Dockerfile                          @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core

@datadog-datadog-prod-us1-2
Copy link

datadog-datadog-prod-us1-2 bot commented Feb 24, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a5517db | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@florentinl florentinl force-pushed the florentin.labelle/properly-forward-signals branch 2 times, most recently from edc43ef to e599acc Compare February 24, 2026 16:58
@florentinl florentinl force-pushed the florentin.labelle/properly-forward-signals branch from 4b1e3f2 to aec0b37 Compare February 25, 2026 11:40
@florentinl florentinl force-pushed the florentin.labelle/properly-forward-signals branch from aec0b37 to a5517db Compare February 25, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant