Github user HyukjinKwon commented on the issue:
https://github.com/apache/spark/pull/18465
@felixcheung, it looks the codes below:
```R
for(i in 0:10000) {
p <- parallel:::mcfork()
if (inherits(p, "masterProcess")) {
stop("unexpected failure")
}
children <- suppressWarnings(parallel:::selectChildren(timeout = 0))
if (is.integer(children)) {
lapply(children, function(child) {
print(parallel:::readChild(child))
tools::pskill(child, tools::SIGUSR1)
})
}
}
```
works fine. Sounds `parallel:::selectChildren` sometimes prints warnings
such as "Bad file descriptor" and looks _few_ pipes are left open but it still
does not at least die.
I also resembled the original way -
```R
for(i in 0:10000) {
p <- parallel:::mcfork()
if (inherits(p, "masterProcess")) {
tools::pskill(child, tools::SIGUSR1)
stop("unexpected failure")
}
children <- parallel:::selectChildren(timeout = 0)
if (is.integer(children)) {
lapply(children, function(child) {
print(parallel:::readChild(child))
})
}
}
```
In my local, this gets easily dead.
---
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]