galaxyproject / galaxyproject/galaxy
Celery tasks should get a task-scoped session
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 1.2k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 169
Description
We scope sqlalchemy sessions based on the request id, or else by thread (the sqlalchemy default) in https://github.com/galaxyproject/galaxy/blob/cdcf3c147972625f3db6c02c9ae23dc42659addc/lib/galaxy/model/base.py#L38
We should probably ensure that celery tasks receive a fresh session that is discarded after the task has completed.
xref https://github.com/galaxyproject/galaxy/pull/12963#discussion_r754421690
Contributor guide
Research direction
Start with lib/galaxy/model/base.py at line 38 to understand the existing request- and thread-scoped SQLAlchemy sessions, then review the referenced discussion in pull request 12963. Done means Celery tasks receive a fresh session and that session is discarded when each task completes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sqlalchemy
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100