Skip to Main Content
Talk Intermediate CC BY-SA 4.0 First Talk

What I learned fixing a bug and adding a feature to Celery.

Proposal status is Rejected
Session Description
  • This talk is about two problems the speaker hit while using Celery, and the two upstream contributions that came out of them — one a bug fix, one a feature. Celery is used all over the Python world, so both are problems other people can run into.

  • The bug — a memory leak: workers using ETA/countdown tasks slowly grew in memory until they were killed and restarted. The talk walks through how it was tracked down — what the heap showed, how ETA tasks get prefetched and held, and why the unacknowledged ones were never released — and the fix that went upstream.

  • The feature — a missing default: Celery sets worker concurrency from the host CPU count, which is wrong inside a container, because it ignores the cgroup CFS quota and starts too many workers. The talk covers the cpuset-vs-CFS-quota gap, why os.cpu_count() misleads in a container, and the cgroup-aware default proposed as an enhancement.

  • The real point isn't the two problems. Neither needed prior knowledge of Celery's internals — both needed the willingness to open the source and read it. This talk is about getting comfortable debugging into a project you didn't write, and turning a local fix into something the whole community gets.

  • Outline: the two problems and why they matter (3m) · the memory leak, end to end (10m) · the concurrency default, end to end (10m) · reading into source and deciding when to upstream (5m) · takeaways and Q&A (2m).

Key Takeaways
  • Two Celery issues you can check in your own projects: ETA-task memory growth, and worker over-provisioning in containers.

  • How to debug into the source of a library you depend on, instead of treating it as a black box.

  • What it takes to turn a local fix into an upstream contribution — a bug fix and a feature — in a project this widely used.

References

Session Categories

Contributing to FOSS
Engineering practice - productivity, debugging
Talk License: CC BY-SA 4.0

Which track are you applying for?

Main track

Speakers

Sandeep Kesarwani
Sandeep Kesarwani Lead Engineer | Mechademy

I'm a lead distributed-systems engineer at Mechademy, building a large industrial-IoT data platform on Python, Django, Celery and TimescaleDB. I've contributed fixes and features to Celery and Kombu, and outside work I build systems projects in Go and read my way through database and distributed-systems internals. I've been working with backend and real-time data systems for about eight years.