Github user HyukjinKwon commented on the issue:
https://github.com/apache/spark/pull/18465
For race condition concern, I tested this as below:
```
vi tmp.R
```
copied and pasted:
```r
kill <- function(children) {
lapply(children, function(child) {
pid <- parallel:::readChild(child)
if (is.integer(pid)) {
if (child == pid) {
print(paste("child PID:", child, "and read PID:", pid))
tools::pskill(child, tools::SIGUSR1)
} else {
print(paste("child PID:", child, "and read PID:", pid, "not
killing"))
}
} else {
print(paste("child PID:", child, "and sent data:", unserialize(pid)))
}
})
}
for(i in 0:10000) {
p <- parallel:::mcfork()
if (inherits(p, "masterProcess")) {
# Send no data
parallel:::mcexit(0L)
} else {
p <- parallel:::mcfork()
if (inherits(p, "masterProcess")) {
# Send custom data
parallel:::sendMaster("arbitrary")
parallel:::sendMaster(123)
parallel:::mcexit(0L)
}
}
c <- parallel:::selectChildren(timeout = 0)
if (is.integer(c)) {
invisible(kill(c))
}
}
```
and ran:
```
Rscript tmp.R
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]