Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-47482: Remove explicit garbage collection #312

Merged
merged 4 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-toml
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
Expand All @@ -22,7 +22,7 @@ repos:
name: isort (python)
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.2
rev: v0.7.3
hooks:
- id: ruff
- repo: https://github.com/numpy/numpydoc
Expand Down
2 changes: 2 additions & 0 deletions doc/changes/DM-47482.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove explicit calls to garbage collector during in-process execution.
Garbage collection can be slow and it is not useful in our common use cases.
6 changes: 0 additions & 6 deletions python/lsst/ctrl/mpexec/mpGraphExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

__all__ = ["MPGraphExecutor", "MPGraphExecutorError", "MPTimeoutError"]

import gc
import importlib
import logging
import multiprocessing
Expand Down Expand Up @@ -596,11 +595,6 @@ def _executeQuantaInProcess(self, graph: QuantumGraph, report: Report) -> None:
qnode.quantum.dataId,
exc_info=exc,
)
finally:
# sqlalchemy has some objects that can last until a garbage
# collection cycle is run, which can happen at unpredictable
# times, run a collection loop here explicitly.
gc.collect()

_LOG.info(
"Executed %d quanta successfully, %d failed and %d remain out of total %d quanta.",
Expand Down
Loading