Skip to content

Commit

Permalink
Merge pull request #312 from lsst/tickets/DM-47482
Browse files Browse the repository at this point in the history
DM-47482: Remove explicit garbage collection
  • Loading branch information
andy-slac authored Nov 12, 2024
2 parents 3abcffb + c19694b commit 34f2479
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
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

0 comments on commit 34f2479

Please sign in to comment.