Skip to content

Commit

Permalink
fix: always ignore SIGPIPE (#1101)
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas authored Oct 18, 2024
1 parent 5601cc9 commit dbd3ae5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frankenphp.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ import (
"io"
"net/http"
"os"
"os/signal"
"runtime"
"strconv"
"strings"
"sync"
"syscall"
"time"
"unsafe"

Expand Down Expand Up @@ -281,6 +283,10 @@ func Init(options ...Option) error {
return AlreaydStartedError
}

// Ignore all SIGPIPE signals to prevent weird issues with systemd: https://github.com/dunglas/frankenphp/issues/1020
// Docker/Moby has a similar hack: https://github.com/moby/moby/blob/d828b032a87606ae34267e349bf7f7ccb1f6495a/cmd/dockerd/docker.go#L87-L90
signal.Ignore(syscall.SIGPIPE)

opt := &opt{}
for _, o := range options {
if err := o(opt); err != nil {
Expand Down

0 comments on commit dbd3ae5

Please sign in to comment.