openpharma / openpharma/rbmi

Clear up parallel processes if processing fails

Open
#488 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
R
Stars
21
Forks
12
PR merge metrics
No merged PRs in 30d

Description

If our parallel processing fails it looks like we don't have anything to clear up the parallel processes if they fail for some reason leading to error messages of the form:

  Error in `ensure_rstan()`: In order to use `method_bayes()` the `rstan` package must be installed. This can be installed from CRAN by running:
  
        install.packages('rstan')
  
  Please note that for `rstan` to work you need to ensure you have a valid C++ toolchain; for details please see:
  https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started#configuring-c-toolchain
  
  
  Backtrace:
      ▆
   1. ├─base::suppressWarnings(...) at test-reproducibility.R:122:5
   2. │ └─base::withCallingHandlers(...)
   3. ├─rbmi::draws(dat, dat_ice, vars, meth, quiet = TRUE) at test-reproducibility.R:123:9
   4. └─rbmi:::draws.bayes(dat, dat_ice, vars, meth, quiet = TRUE)
   5.   └─rbmi:::fit_mcmc(...)
   6.     └─rbmi:::get_stan_model()
   7.       └─rbmi:::ensure_rstan()
  
  [ FAIL 6 | WARN 0 | SKIP 15 | PASS 1253 ]
  Error: Test failures
  In addition: Warning messages:
  1: In for (call in calls) { :
    closing unused connection 8 (<-localhost.localdomain:11879)
  2: In for (call in calls) { :
    closing unused connection 7 (<-localhost.localdomain:11879)
  3: In for (call in calls) { :
    closing unused connection 6 (<-localhost.localdomain:11879)
  4: In for (call in calls) { :
    closing unused connection 5 (<-localhost.localdomain:11879)
  Execution halted

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with test-reproducibility.R around lines 122-123 and trace rbmi:::draws.bayes through fit_mcmc, get_stan_model, and ensure_rstan while reproducing the failed parallel run. Done means failed processing leaves no parallel processes or unused connections, and the reported test no longer emits the cleanup warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.