Title: Celery integration leaking file descriptors · Issue #5422 · getsentry/sentry-python · GitHub
Open Graph Title: Celery integration leaking file descriptors · Issue #5422 · getsentry/sentry-python
X Title: Celery integration leaking file descriptors · Issue #5422 · getsentry/sentry-python
Description: How do you use Sentry? Sentry Saas (sentry.io) Version 2.51.0 Steps to Reproduce After upgrading to Python 3.14, our Celery tasks started failing with 'too many open files' errors. We found that Sentry's Celery integration leaks a file d...
Open Graph Description: How do you use Sentry? Sentry Saas (sentry.io) Version 2.51.0 Steps to Reproduce After upgrading to Python 3.14, our Celery tasks started failing with 'too many open files' errors. We found that Se...
X Description: How do you use Sentry? Sentry Saas (sentry.io) Version 2.51.0 Steps to Reproduce After upgrading to Python 3.14, our Celery tasks started failing with 'too many open files' errors. We found...
Opengraph URL: https://github.com/getsentry/sentry-python/issues/5422
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Celery integration leaking file descriptors","articleBody":"### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Version\n\n2.51.0\n\n### Steps to Reproduce\n\nAfter upgrading to Python 3.14, our Celery tasks started failing with 'too many open files' errors. We found that\n- Sentry's Celery integration leaks a file descriptor for every task executed\n- Python 3.14's [new GC](https://docs.python.org/3/whatsnew/3.14.html#whatsnew314-incremental-gc) is less aggressive and leaked file descriptors can hang around for much longer\n\nThe relevant code is: https://github.com/getsentry/sentry-python/blob/bf0a683137015c9e866782fd87a785addf1f1da8/sentry_sdk/integrations/celery/__init__.py#L394-L398\n\nAccessing the `transport` property will create a new redis connection. (We use a redis broker but I assume the behavior is the same for other transport types.) This connection is never closed so it's left to the GC to clean up.\n\nTo see this in action, take the \"add\" example from https://docs.sentry.io/platforms/python/integrations/celery/, configure a redis broker and change the main function to queue many tasks:\n```\ndef main():\n for _ in range(1000):\n add.delay(4, 4)\n````\nUse Python 3.14, `celery[redis]==5.6.2`, `sentry-sdk==2.51.0`. Then check `/proc/(worker pid)/fd/`.\n\n### Expected Result\n\nThe Celery worker has few open files.\n\n### Actual Result\n\nThe Celery worker has hundreds of `anon_inode:[eventpoll]` files.","author":{"url":"https://github.com/pdewacht","@type":"Person","name":"pdewacht"},"datePublished":"2026-02-04T14:26:15Z","url":"https://github.com/getsentry/sentry-python/issues/5422"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f9a345bc-835e-252b-64fd-cb6cd52e1738 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A694:2978F1:9483C7:C16794:6B00E068 |
| html-safe-nonce | 9ac848e56d4b46d4e0d6b5df68f2e794aa7d38847e04ff0083c082d2b655408b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjk0OjI5NzhGMTo5NDgzQzc6QzE2Nzk0OjZCMDBFMDY4IiwidmlzaXRvcl9pZCI6IjYzNjAwNjI3NTI4MTk1Njg3NDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 51823475e8a4c6c74ed3f21683c855402bbcdfc221913ae1e555152f274dd960 |
| hovercard-subject-tag | issue:3896819801 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/5422/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0a37e9324f3fd947400973797eadcd4b8b2e1e43c403a59d736df6457d59006b/getsentry/sentry-python/issues/5422 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0a37e9324f3fd947400973797eadcd4b8b2e1e43c403a59d736df6457d59006b/getsentry/sentry-python/issues/5422 |
| og:image:alt | How do you use Sentry? Sentry Saas (sentry.io) Version 2.51.0 Steps to Reproduce After upgrading to Python 3.14, our Celery tasks started failing with 'too many open files' errors. We found that Se... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pdewacht |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 137814779 |
| octolytics-dimension-repository_nwo | getsentry/sentry-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 137814779 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width