Pavel Krivitsky
2019-May-03 10:47 UTC
[Rd] Strange error messages from parallel::mcparallel family under 3.6.0
Dear All, Since upgrading to 3.6.0, I've been getting a strange error messages from the child process when using mcparallel/mccollect. Before filing a report in the Bugzilla, I want to figure out whether I had been doing something wrong all this time and R 3.6.0 has exposed it, or whether something else is going on. # Background # Ultimately, what I want to do is to be able to set a time limit for an expression to be evaluated that would be enforced even inside compiled code. (R.utils::withTimeout() uses base::setTimeLimit(), which can only enforce within R code.) # Implementation # The approach that my implementation, statnet.common::forkTimeout() (source attached for convenience), uses is to call mcparallel() to evaluate the expression in a child process, then mccollect() with wait=FALSE and a timeout to give it a chance to finish. If it runs past the timeout, the child process is killed and an onTimeout value is returned. (This only works on Unix-alikes, but it's better than nothing.) # The problem # Since 3.6.0---and I've tested fresh installs of 3.6.0 and 3.5.3 side- by-side---I've been getting strange messages. Running source("forkTimeout.R") # attached repeat print(forkTimeout({Sys.sleep(1);TRUE}, timeout=3)) results in [1] TRUE [1] TRUE Error in mcexit(0L) : ignoring SIGPIPE signal [1] TRUE [1] TRUE Error in mcexit(0L) : ignoring SIGPIPE signal [1] TRUE [1] TRUE [1] TRUE until interrupted. Running options(error=traceback) repeat print(forkTimeout({Sys.sleep(1);TRUE}, timeout=3)) results in sporadic messages of the form: Error in mcexit(0L) : ignoring SIGPIPE signal 6: selectChildren(jobs, timeout) 5: parallel::mccollect(child, wait = FALSE, timeout = timeout) at forkTimeout.R#75 4: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning")) 3: suppressWarnings(parallel::mccollect(child, wait = FALSE, timeout timeout)) at forkTimeout.R#75 2: forkTimeout({ Sys.sleep(1) ... 1: print(forkTimeout({ Sys.sleep(1) ... So, these messages do not appear to prevent the child process from returning valid output, but I've never seen them before R 3.6.0, so I wonder if I am doing something wrong. Session info is also attached. Thanks in advance, Pavel -- Pavel Krivitsky Lecturer in Statistics National Institute of Applied Statistics Research Australia (NIASRA) School of Mathematics and Applied Statistics | Building 39C Room 154 University of Wollongong NSW 2522 Australia T +61 2 4221 3713 Web (NIASRA): http://niasra.uow.edu.au/index.html Web (Personal): http://www.krivitsky.net/research ORCID: 0000-0002-9101-3362 NOTICE: This email is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Please consider the environment before printing this email. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: sessionInfo.txt URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20190503/bfe185b4/attachment.txt> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: forkTimeout.R URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20190503/bfe185b4/attachment.ksh>
Tomas Kalibera
2019-May-07 11:53 UTC
[Rd] Strange error messages from parallel::mcparallel family under 3.6.0
Thanks, fixed in R-devel and R-patched. The error happens in the child process when it is already exiting, after it had delivered a result, so this should not cause any trouble in an unpatched version of R (apart from showing that message). It is specific to mccollect(wait=FALSE). Best Tomas On 5/3/19 12:47 PM, Pavel Krivitsky wrote:> Dear All, > > Since upgrading to 3.6.0, I've been getting a strange error messages > from the child process when using mcparallel/mccollect. Before filing a report in the Bugzilla, I want to figure out whether I had been doing something wrong all this time and R 3.6.0 has exposed it, or whether something else is going on. > > # Background # > > Ultimately, what I want to do is to be able to set a time limit for an > expression to be evaluated that would be enforced even inside compiled > code. (R.utils::withTimeout() uses base::setTimeLimit(), which can only > enforce within R code.) > > # Implementation # > > The approach that my implementation, statnet.common::forkTimeout() > (source attached for convenience), uses is to call mcparallel() to > evaluate the expression in a child process, then mccollect() with > wait=FALSE and a timeout to give it a chance to finish. If it runs past > the timeout, the child process is killed and an onTimeout value is > returned. (This only works on Unix-alikes, but it's better than > nothing.) > > # The problem # > > Since 3.6.0---and I've tested fresh installs of 3.6.0 and 3.5.3 side- > by-side---I've been getting strange messages. > > Running > > source("forkTimeout.R") # attached > repeat print(forkTimeout({Sys.sleep(1);TRUE}, timeout=3)) > > results in > > [1] TRUE > [1] TRUE > Error in mcexit(0L) : ignoring SIGPIPE signal > [1] TRUE > [1] TRUE > Error in mcexit(0L) : ignoring SIGPIPE signal > [1] TRUE > [1] TRUE > [1] TRUE > > until interrupted. Running > > options(error=traceback) > repeat print(forkTimeout({Sys.sleep(1);TRUE}, timeout=3)) > > results in sporadic messages of the form: > > Error in mcexit(0L) : ignoring SIGPIPE signal > 6: selectChildren(jobs, timeout) > 5: parallel::mccollect(child, wait = FALSE, timeout = timeout) at > forkTimeout.R#75 > 4: withCallingHandlers(expr, warning = function(w) > invokeRestart("muffleWarning")) > 3: suppressWarnings(parallel::mccollect(child, wait = FALSE, timeout > timeout)) at forkTimeout.R#75 > 2: forkTimeout({ > Sys.sleep(1) > ... > 1: print(forkTimeout({ > Sys.sleep(1) > ... > > So, these messages do not appear to prevent the child process from > returning valid output, but I've never seen them before R 3.6.0, so I > wonder if I am doing something wrong. Session info is also attached. > > Thanks in advance, > Pavel > > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel[[alternative HTML version deleted]]
Reasonably Related Threads
- DOCUMENTATION(?): parallel::mcparallel() gives various types of "Error in unserialize(r) : ..." errors if value is of type raw
- mcparallel / mccollect
- Race condition on parallel package's mcexit and rmChild
- Race condition on parallel package's mcexit and rmChild
- Listing all spawned jobs/processed after parallel::mcparallel()?