Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

nested futures that doesn't terminate

Aperta
#348 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
r

Direzione di ricerca

Inizia con il riproduttore in R nell’issue, confrontando il piano sequenziale con il piano annidato multiprocesso/sequenziale intorno a furrr::future_map. Esamina come future e parallel gestiscono l’arresto dei processi figli, incluso il messaggio segnalato „unable to terminate some child processes“. Il lavoro è completato quando la riproduzione ha una causa documentata e una risoluzione verificata, oppure un report upstream chiaramente circoscritto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

cannot-parallelize-bc-non-exportable-object documentation

I am having issues with nested future calls.

Here I'm using mlr3 and furrr, both using future package. When using them both together I'm having issues to have the parallelized calls to terminate.

library(magrittr)
library(mlr3)
library(mlr3learners)
dtas_lst <-
  list(
    dta1 = iris %>% dplyr::select(-Species) %>% utils::head(75),
    dta2 = iris %>% dplyr::select(-Species) %>% utils::tail(75)
  )

run_xgb <- function(dta, target_column = "Sepal.Length") {
  ttsk <- mlr3::TaskRegr$new("ttsk", backend = dta, target = target_column)
  learner <-
    mlr3::lrn(
      "regr.xgboost",
      objective = "reg:linear",
      eval_metric = "rmse",
      nrounds = 100,
      verbose = 0
    )
  learner$train(ttsk)
  learner$predict(ttsk)$response
}
future::plan(list(future::sequential))
furrr::future_map(dtas_lst, run_xgb, .progress = TRUE) # works!
future::plan(list(future::multiprocess, future::sequential))
furrr::future_map(dtas_lst, run_xgb, .progress = TRUE) # doesn't terminate

I've had cases where the parallel runs do work once during a session, but then not terminating on a rerun.

Sometimes when closing down the session (after manually terminating the parallel run), I get the below message

# Error while shutting down parallel: unable to terminate some child processes

Upon googling this, I found that I could do the following check.

parallel::mcparallel(scan(n = 1, quiet = TRUE))
# $pid
# [1] 32763

# $fd
# [1] 21 24

# attr(,"class")
# [1] "parallelJob"  "childProcess" "process"

Does anyone have any solutions to this? Is this perhaps a bug? Related to future or perhaps parallel or other package? I was having the same issue when I was running the mlr package.

> Sys.info()
                                     sysname
                                     "Linux"
                                     release
                         "4.15.0-66-generic"
                                     version
"#75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019"
...
                                     machine
                                    "x86_64"
...
Lingua principale
R
Stelle
1k
Fork
93
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di futureverse/future

Tutte le issue di futureverse/future

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.