Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore SIGPIPE in send() and recv() #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

rfaelens
Copy link

@rfaelens rfaelens commented Mar 9, 2018

This solution is intended to solve issue #100. The method is very similar
to what is being done in the internal R http server (see Rhttpd.c).
It should therefore not cause any issues in other parts of R.

…eceiving EPIPE

This solution is intended to solve issue s-u#100. The method is very similar
to what is being done in the internal R http server (see Rhttpd.c).
It should therefore not cause any issues in other parts of R.
@karlroberts
Copy link

When is this PR going to happen? SIGPIPE errors are the bane of my life right now.

@yannrichet
Copy link

To turn around, ou can try to encapsulate the R call which generate the bug with a try(), or use some redirection of output & error streams using sink() before...
In some cases, it will be sufficient.

@rfaelens
Copy link
Author

rfaelens commented Aug 30, 2018 via email

@s-u
Copy link
Owner

s-u commented Aug 30, 2018

Well, the problem is a bit more complicated - officially, it's impossible to handle SIGPIPE properly without support from R itself, because it will replace the handler with its own version. Your approach here doesn't work, because R_ignore_SIGPIPE is not part of the API and thus cannot be used. That piece is only used by the internal HTTP server.

We are working on a more clean solution in R where R would allow packages to register certain handlers (like SIGCHLD or SIGPIPE) in a way that makes it possible to manipulate the handlers in different situations automatically.

That said, I think you're trying to solve the wrong problem - you cannot in general prevent R shutdown, so this is just one of may ways you ca get there - I'd recommend the approach I outlined in the issue - make sure each child has it's own tempdir - it's much safer in many ways that that's what we use.

@rfaelens
Copy link
Author

rfaelens commented Aug 30, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants