From p@ve| @end|ng |rom uow@edu@@u  Fri May  3 12:47:23 2019
From: p@ve| @end|ng |rom uow@edu@@u (Pavel Krivitsky)
Date: Fri, 3 May 2019 10:47:23 +0000
Subject: [Rd] Strange error messages from parallel::mcparallel family under
 3.6.0
Message-ID: <93e743cdffe03aa9c50a76d0f40b65d89b41031e.camel@uow.edu.au>

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>


[Rd] Strange error messages from parallel::mcparallel family under 3.6.0
Pavel Krivitsky