From 67b6f895975205ca1e311ec08079c9ed84c1d6a7 Mon Sep 17 00:00:00 2001 From: Joachim Ungar Date: Wed, 9 Mar 2022 14:26:11 +0100 Subject: [PATCH 1/2] don't raise KeyError when cleaning up futures --- mapchete/_executor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mapchete/_executor.py b/mapchete/_executor.py index bcdc1dd3..b9e267d3 100644 --- a/mapchete/_executor.py +++ b/mapchete/_executor.py @@ -180,7 +180,10 @@ def _finished_future(self, future, result=None, _dask=False): Release future from cluster explicitly and wrap result around FinishedFuture object. """ if not _dask: - self.running_futures.remove(future) + try: + self.running_futures.remove(future) + except KeyError: # pragma: no cover + pass self.finished_futures.discard(future) fut_exception = future.exception(timeout=FUTURE_TIMEOUT) if fut_exception: # pragma: no cover From b2a6363d5e5f7b8131698dda15322c38892cc012 Mon Sep 17 00:00:00 2001 From: Joachim Ungar Date: Wed, 9 Mar 2022 14:26:25 +0100 Subject: [PATCH 2/2] bump version; update changelog --- CHANGELOG.rst | 9 +++++++++ mapchete/__init__.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 43152837..b09ab059 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,15 @@ Changelog ######### +--------------------- +2022.3.0 - 2022-03-09 +--------------------- + +* core + * use batches when yielding completed futures from dask + * fix ``KeyError`` when removing futures from threads executor + + --------------------- 2022.2.2 - 2022-02-25 --------------------- diff --git a/mapchete/__init__.py b/mapchete/__init__.py index 4af891f8..a549b4f8 100644 --- a/mapchete/__init__.py +++ b/mapchete/__init__.py @@ -9,7 +9,7 @@ __all__ = ["open", "count_tiles", "Mapchete", "MapcheteProcess", "ProcessInfo", "Timer"] -__version__ = "2022.2.2" +__version__ = "2022.3.0" logger = logging.getLogger(__name__)