Skip to content

Commit d9910f9

Browse files
committed
Remove SIGPIPE handler (#2558)
## Proposed Changes Remove the SIGPIPE handler added in #2486. We saw some of the testnet nodes running under `systemd` being stopped due to `journald` restarts. The systemd docs state: > If systemd-journald.service is stopped, the stream connections associated with all services are terminated. Further writes to those streams by the service will result in EPIPE errors. In order to react gracefully in this case it is recommended that programs logging to standard output/error ignore such errors. If the SIGPIPE UNIX signal handler is not blocked or turned off, such write attempts will also result in such process signals being generated, see signal(7). From https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html ## Additional Info It turned out that the issue described in #2114 was due to `tee`'s behaviour rather than Lighthouse's, so the SIGPIPE handler isn't required for any current use case. An alternative to disabling it all together would be to exit with a non-zero code so that systemd knows to restart the process, but it seems more desirable to tolerate journald glitches than to restart frequently.
1 parent ac27422 commit d9910f9

File tree

1 file changed

+0
-9
lines changed
  • lighthouse/environment/src

1 file changed

+0
-9
lines changed

lighthouse/environment/src/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -391,15 +391,6 @@ impl<E: EthSpec> Environment<E> {
391391
Err(e) => error!(self.log, "Could not register SIGHUP handler"; "error" => e),
392392
}
393393

394-
// setup for handling a SIGPIPE
395-
match signal(SignalKind::pipe()) {
396-
Ok(pipe_stream) => {
397-
let pipe = SignalFuture::new(pipe_stream, "Received SIGPIPE");
398-
handles.push(pipe);
399-
}
400-
Err(e) => error!(self.log, "Could not register SIGPIPE handler"; "error" => e),
401-
}
402-
403394
future::select(inner_shutdown, future::select_all(handles.into_iter())).await
404395
}) {
405396
future::Either::Left((Ok(reason), _)) => {

0 commit comments

Comments
 (0)