From 3f29034f74893be40729c725ff524262030036c3 Mon Sep 17 00:00:00 2001 From: Eileen Kuehn Date: Thu, 12 Dec 2019 16:32:50 +0100 Subject: [PATCH 1/2] added await instant to ensure that jobs get correct state when being cancelled --- lapis/drone.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lapis/drone.py b/lapis/drone.py index 1932537..48142c6 100644 --- a/lapis/drone.py +++ b/lapis/drone.py @@ -137,7 +137,9 @@ async def _run_job(self, job: Job, kill: bool): job.resources[resource_key] < job.used_resources[resource_key] ): + await instant job_execution.cancel() + await instant except KeyError: # check is not relevant if the data is not stored pass @@ -146,9 +148,11 @@ async def _run_job(self, job: Job, kill: bool): except ResourcesUnavailable: await instant job_execution.cancel() + await instant except AssertionError: await instant job_execution.cancel() + await instant self.jobs -= 1 await self.scheduler.job_finished(job) self._utilisation = self._allocation = None From 92989aa91d1a5e03cd3be46e94edac8f96077a13 Mon Sep 17 00:00:00 2001 From: Eileen Kuehn Date: Thu, 12 Dec 2019 16:39:12 +0100 Subject: [PATCH 2/2] added change fragment --- docs/source/changelog.rst | 6 ++++-- docs/source/changes/80.job_cancelation.yaml | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 docs/source/changes/80.job_cancelation.yaml diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index b201bb3..8ea72ab 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -1,4 +1,4 @@ -.. Created by log.py at 2019-11-30, command +.. Created by log.py at 2019-12-12, command '/Users/eileenwork/development/work/lapis/venv/lib/python3.7/site-packages/change/__main__.py log docs/source/changes compile --output docs/source/changelog.rst' based on the format of 'https://keepachangelog.com/' ######### @@ -8,7 +8,7 @@ ChangeLog Upcoming ======== -Version [Unreleased] - 2019-11-30 +Version [Unreleased] - 2019-12-12 +++++++++++++++++++++++++++++++++ * **[Added]** Basic documentation @@ -23,6 +23,7 @@ Version [Unreleased] - 2019-11-30 * **[Fixed]** Proper termination of simulation * **[Fixed]** Jobs execution within drones * **[Fixed]** Scheduling of jobs +* **[Fixed]** Cancelation of jobs * **[Fixed]** Importing of HTCondor jobs 0.3 Series @@ -64,3 +65,4 @@ Version [0.1.1] - 2019-10-24 * **[Fixed]** Calculation of used and requested resource ratio * **[Fixed]** StopIteration handling by Job Generator * **[Fixed]** Importing of SWF files + diff --git a/docs/source/changes/80.job_cancelation.yaml b/docs/source/changes/80.job_cancelation.yaml new file mode 100644 index 0000000..7738cc4 --- /dev/null +++ b/docs/source/changes/80.job_cancelation.yaml @@ -0,0 +1,8 @@ +category: fixed +summary: "Cancelation of jobs" +description: | + When a drone tried to cancel a job it could happen that the success state + of that job was not properly set as the job was not yet in running state. + This is fixed now by additionally waiting for an `instant`. +pull requests: + - 80