Commit df4ed10f authored by Levin Zimmermann's avatar Levin Zimmermann

x signinfo?

parent 9544fc02
...@@ -9,6 +9,7 @@ require ( ...@@ -9,6 +9,7 @@ require (
github.com/kisielk/og-rek v1.2.0 github.com/kisielk/og-rek v1.2.0
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.8.4 github.com/stretchr/testify v1.8.4
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
lab.nexedi.com/kirr/go123 v0.0.0-20230714134036-155506a9880e lab.nexedi.com/kirr/go123 v0.0.0-20230714134036-155506a9880e
lab.nexedi.com/kirr/neo/go v0.0.0-20230524100036-4c9414ea9a03 lab.nexedi.com/kirr/neo/go v0.0.0-20230524100036-4c9414ea9a03
) )
......
...@@ -509,6 +509,8 @@ import ( ...@@ -509,6 +509,8 @@ import (
"github.com/hanwen/go-fuse/v2/fuse/nodefs" "github.com/hanwen/go-fuse/v2/fuse/nodefs"
"github.com/pkg/errors" "github.com/pkg/errors"
"golang.org/x/sys/unix"
"lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xzodb" "lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xzodb"
"lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/zdata" "lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/zdata"
) )
...@@ -1495,12 +1497,23 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) { ...@@ -1495,12 +1497,23 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
// access to which address generated this error going in si_addr field of // access to which address generated this error going in si_addr field of
// siginfo structure. It would be good if we can mimic that behaviour to a // siginfo structure. It would be good if we can mimic that behaviour to a
// reasonable extent if possible." // reasonable extent if possible."
err := syscall.Kill(pid, syscall.Signal(syscall.SIGBUS)) //
// we need https://pkg.go.dev/golang.org/x/sys/unix#SignalfdSiginfo
// but there seems to be no API to use this struct?
// => wait, that's https://linux.die.net/man/2/signalfd
// ('signalfd_siginfo'), which is different to siginfo_t,
// see https://man7.org/linux/man-pages/man2/sigaction.2.html
//
// maybe we need to implement something similar to
//
// https://cs.opensource.google/go/x/sys/+/refs/tags/v0.12.0:unix/zsyscall_linux.go;l=2106-2111
// ?
err := unix.Kill(pid, syscall.Signal(syscall.SIGBUS))
if err != nil { if err != nil {
return err return err
} }
if isProcessAlive(pid, time.Second * 1) { if isProcessAlive(pid, time.Second * 1) {
err = syscall.Kill(pid, syscall.Signal(syscall.SIGKILL)) err = unix.Kill(pid, syscall.Signal(syscall.SIGKILL))
if err != nil { if err != nil {
return err return err
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment