https://github.com/marginalhours/pq-issue-replication
Quick replication of a PQ task API issue
https://github.com/marginalhours/pq-issue-replication
Last synced: 4 months ago
JSON representation
Quick replication of a PQ task API issue
- Host: GitHub
- URL: https://github.com/marginalhours/pq-issue-replication
- Owner: marginalhours
- Created: 2021-07-21T12:37:34.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-21T12:38:04.000Z (about 5 years ago)
- Last Synced: 2025-01-01T08:15:08.836Z (over 1 year ago)
- Language: Python
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PQ task bug replication
Tested with `python==3.9.5` and package versions in `requirements.txt`
## Testing
Spin up a `postgres` instance somehow. I used:
```
docker run --rm -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres
```
Then in one terminal, run `python publisher.py` to start publishing tasks.
In another, run `python consumer.py` to start consuming tasks.
## Scenarios
- When running `consumer.py`, if line `7` is commented out and the task is not imported,
then the pq `queue` table in postgres will rapidly grow in size (as seen through `publisher.py` output).
No output will be produced by the `consumer.py` script even though the `dummy_task` task should print
to stdout.
- When running `consumer.py` with line `7` *un*commented then the pq `queue` table will grow much more
slowly (only from the inserts from `publisher.py`). `consumer.py` will produce output as it executes
the tasks successfully.