Strange error messages from parallel::mcparallel family under 3.6.0

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange error messages from parallel::mcparallel family under 3.6.0

Pavel Krivitsky
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.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

sessionInfo.txt (1K) Download Attachment
forkTimeout.R (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Strange error messages from parallel::mcparallel family under 3.6.0

Tomas Kalibera
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
>
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel