Skip to content

Commit

Permalink
Send both cancellation and termination requests to end jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Jul 22, 2024
1 parent 300819f commit 81ee541
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Description: In computationally demanding analysis projects,
'clustermq' by Schubert (2019) <doi:10.1093/bioinformatics/btz284>),
and 'batchtools' by Lang, Bischl, and Surmann (2017).
<doi:10.21105/joss.00135>.
Version: 0.0.6.9000
Version: 0.0.6.9001
License: MIT + file LICENSE
URL: https://wlandau.github.io/crew.aws.batch/,
https://github.com/wlandau/crew.aws.batch
Expand Down Expand Up @@ -51,4 +51,4 @@ Encoding: UTF-8
Language: en-US
Config/testthat/edition: 3
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# crew.aws.batch 0.0.6.9000 (development)

# crew.aws.batch 0.0.6.9001 (development)

* Send both cancellation and termination requests to end jobs.

# crew.aws.batch 0.0.6

Expand Down
4 changes: 4 additions & 0 deletions R/crew_launcher_aws_batch.R
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,10 @@ crew_launcher_aws_batch_terminate <- function(args_client, job_id) {
# nocov start
# Tested in tests/controller/minimal.R
client <- do.call(what = paws.compute::batch, args = args_client)
client$cancel_job(
jobId = job_id,
reason = "cancelled by crew controller"
)
client$terminate_job(
jobId = job_id,
reason = "terminated by crew controller"
Expand Down
3 changes: 2 additions & 1 deletion R/crew_monitor_aws_batch.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ crew_class_monitor_aws_batch <- R6::R6Class(
#' if the R process is interactive and `length(ids)` is greater than 1.
terminate = function(
ids,
reason = "terminated by crew.aws.batch monitor",
reason = "cancelled/terminated by crew.aws.batch monitor",
verbose = TRUE
) {
# Covered in tests/interactive/jobs.R
Expand All @@ -215,6 +215,7 @@ crew_class_monitor_aws_batch <- R6::R6Class(
client <- private$.client()
progress <- progress_init(verbose = verbose, total = length(ids))
for (id in ids) {
client$cancel_job(jobId = id, reason = reason)
client$terminate_job(jobId = id, reason = reason)
progress_update(progress)
}
Expand Down
2 changes: 1 addition & 1 deletion man/crew_class_monitor_aws_batch.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 81ee541

Please sign in to comment.