Skip to content

Conversation

@seer-by-sentry
Copy link

Fixes GITINGEST-2. The issue was that: Uvicorn cancels ASGI receive() during shutdown; Starlette's lifespan handler does not catch CancelledError.

  • Modified the startup_event function to use a try...finally block to ensure that the background task _remove_old_repositories is always cancelled, even if an exception occurs during the application's startup.

This fix was generated by Seer in Sentry, triggered by Mickael. 👁️ Run ID: 15919

Not quite right? Click here to continue debugging with Seer.

@MickaelCa MickaelCa force-pushed the seer/ensure-background-task-cancellation branch from 40f3cc9 to f06a6b5 Compare July 17, 2025 11:39
@github-actions
Copy link

github-actions bot commented Jul 17, 2025

⚙️ Preview environment was undeployed.

@MickaelCa MickaelCa added push-container Allow the PR to build & push a docker container instead of just building it and removed push-container Allow the PR to build & push a docker container instead of just building it deploy-pr-temp-env labels Jul 17, 2025
with suppress(asyncio.CancelledError):
await task # swallow the cancellation signal
try:
yield # app runs while the background task is alive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comments seems redundant, we understand what's going on here.

@github-actions
Copy link

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions
Copy link

Hi there! We haven’t seen activity on this pull request for 45 days, so I’m marking it as stale.
If you’d like to keep it open, please leave a comment within 10 days. Thanks!

@github-actions github-actions bot added the stale label Sep 14, 2025
@github-actions
Copy link

Hi there! We haven’t heard anything for 10 days, so I’m closing this pull request. Feel free to reopen if you’d like to continue working on it. Thanks!

@github-actions github-actions bot closed this Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants