Skip to content

Commit 337139e

Browse files
committed
Do not call quit() in worker teardown
Because it creates a race condition and the output of the teardown function might be lost. This means that covr probably does not work for these workers, because there is no time for it to write out the coverage counters.
1 parent a5b90c1 commit 337139e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/parallel.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,10 @@ queue_teardown <- function(queue) {
313313
tasks <- queue$list_tasks()
314314
num <- nrow(tasks)
315315

316+
# calling quit() here creates a race condition, and the output of
317+
# the deferred_run() might be lost.
316318
clean_fn <- function() {
317319
withr::deferred_run(.GlobalEnv)
318-
quit(save = "no", status = 0L, runLast = TRUE)
319320
}
320321

321322
topoll <- list()

0 commit comments

Comments
 (0)