Skip to content

Commit

Permalink
fix(lifecycle): prevent signal forwarding (#1201)
Browse files Browse the repository at this point in the history
  • Loading branch information
steebchen committed Feb 26, 2024
1 parent f4252f5 commit c207dc0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engine/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ func (e *QueryEngine) spawn(file string) error {

e.cmd = exec.Command(file, "-p", port, "--enable-raw-queries")

e.cmd.SysProcAttr = getSysProcAttr()

e.cmd.Stdout = os.Stdout

e.onEngineError = make(chan string)
Expand Down
11 changes: 11 additions & 0 deletions engine/lifecycle_unix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//go:build !windows

package engine

import "syscall"

func getSysProcAttr() *syscall.SysProcAttr {
return &syscall.SysProcAttr{
Setpgid: true,
}
}
7 changes: 7 additions & 0 deletions engine/lifecycle_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package engine

import "syscall"

func getSysProcAttr() *syscall.SysProcAttr {
return &syscall.SysProcAttr{}
}

0 comments on commit c207dc0

Please sign in to comment.