Closed avehtari closed 3 months ago
Looks like the zombies are coming from brms::log_lik(fit_bern)
It seems this occurs when cmdstanr
is loaded, even if the backend used to fit the brmsfit
was rstan
.
m <- brms::brm(yield ~ 1, npk, backend = "rstan")
brms::log_lik(m) # no zombies
library(cmdstanr)
brms::log_lik(m) # creates zombies
The zombies are lefty behind by the line https://github.com/paul-buerkner/brms/blob/298b947fa9cfb914aeb7cb3aab7974aa179682b1/R/log_lik.R#L127
out <- plapply(seq_len(N), log_lik_fun, cores = cores, prep = object)
I opened an issue https://github.com/paul-buerkner/brms/issues/1658 in brms
repo, and closing this
A minimal example I see zombies left behind when using
brms
withcmdstanr
backend. Eventually the zombies crowd the system which runs out process id's and fails to fork new threads. (Zombies are subprocesses that die, but the parent process doesn't organize funeral for them (with wait() call))EDIT: added comment that number of zombies depends on mc.cores EDIT2: clarified that this happens only with cmdstanr backend EDIT3: only with brms + cmdstanr backend, not with plain cmdstanr