Skip to content

Commit

Permalink
Merge pull request #80 from MatterMiners/fix/job-cancelation
Browse files Browse the repository at this point in the history
Job cancellation
  • Loading branch information
eileen-kuehn authored Dec 12, 2019
2 parents a74d181 + 92989aa commit 989b805
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -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/'
#########
Expand All @@ -8,7 +8,7 @@ ChangeLog
Upcoming
========

Version [Unreleased] - 2019-11-30
Version [Unreleased] - 2019-12-12
+++++++++++++++++++++++++++++++++

* **[Added]** Basic documentation
Expand All @@ -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
Expand Down Expand Up @@ -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

8 changes: 8 additions & 0 deletions docs/source/changes/80.job_cancelation.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions lapis/drone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 989b805

Please sign in to comment.