8000 Fix flushing in Exception Replay by nhulston · Pull Request #601 · DataDog/datadog-lambda-python · GitHub
[go: up one dir, main page]

Skip to content

F 8000 ix flushing in Exception Replay #601

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2025

Conversation

nhulston
Copy link
Contributor
@nhulston nhulston commented May 16, 2025

What does this PR do?

In between Lambdas (after END, before START), all threads are frozen, so queued up tasks cannot run until the next invocation.

Currently, in Python, exception replay for one invocation can only works if another invocation happens in the same execution context. This is because periodic (which is the tracer's method for making requests to the Exception Replay endpoint) is queued up but frozen on END, and only fires if another START event is received.

This change just calls the periodic() method at the end of the Lambda but before the threads are frozen. This fixes Exception Replay flushing and no longer requires a separate invocation to work.

Motivation

https://datadoghq.atlassian.net/browse/SVLS-6845

Testing Guidelines

Manually - exception replay now works after only one invocation.

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@nhulston nhulston marked this pull request as ready for review May 16, 2025 14:54
@nhulston nhulston requested a review from a team as a code owner May 16, 2025 14:54
@nhulston nhulston merged commit 497aadc into main May 16, 2025
60 checks passed
@nhulston nhulston deleted the nicholas.hulston/fix-flushing-exception-replay branch May 16, 2025 18:22
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.

3 participants
0