https://github.com/50-course/celery-class-based-tasks-postmortem
Postmortem repository to reproduce `leaking state between class-based tasks` - Ticket #8972 @celery/celery
https://github.com/50-course/celery-class-based-tasks-postmortem
Last synced: 8 months ago
JSON representation
Postmortem repository to reproduce `leaking state between class-based tasks` - Ticket #8972 @celery/celery
- Host: GitHub
- URL: https://github.com/50-course/celery-class-based-tasks-postmortem
- Owner: 50-Course
- Created: 2024-04-19T17:00:50.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-20T14:27:57.000Z (almost 2 years ago)
- Last Synced: 2025-03-22T09:43:45.481Z (11 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Post-mortem: Leaking state between class based tasks
Ticket No: `#8972`
This repository aims to perform post-mortem of the production bug in @celery organization.
Reference: https://github.com/celery/celery/issues/8972
Bug description:
> I have a list defined in my **init** method of my task. As the task runs things are appended to the list. I'm noticing that the class is only instantiated once. The list attached to self seems to persist between jobs. This seems very unintuitive and seems like it could lead to concurrency issues with a thread based worker.
Installation
To install the dependencies, run as follows in a virtual environment:
```sh
$ pip install -r requirements.txt
```
Usage
To run the test case, execute the following command:
```sh
$ python test.py
```
or with Docker, no installations required other than docker on your machine:
```sh
$ docker compose up
```
Bug tracker
Please report error regarding this issue to official `celery` repository. Or continue the discussion at: celery/celery#8972