rcrowley / goagain

Zero-downtime restarts in Go
Other
2.1k stars 144 forks source link

single strategy error in mac #32

Open ColderLee opened 5 years ago

ColderLee commented 5 years ago

In Single strategy,setEnvs error in mac.

error message

panic: reflect: call of reflect.Value.Int on zero Value

goroutine 1 [running]:
reflect.Value.Int(...)
    /usr/local/go/src/reflect/value.go:961

solution

Replace with below code will solve this problems.

v := reflect.ValueOf(l).Elem().FieldByName("fd").Elem().FieldByName("pfd")
fd = uintptr(v.FieldByName("Sysfd").Int())
brandur commented 5 years ago

Nice fix! I just ran into the same problem and came here to see if it was a general one.

Given the project seems to be broken out of the box for a common OS, does that mean it's effectively unmaintained/dead? I ask because I'm trying to decide on graceful restart library, and would love to know about what the accepted state of the art for this kind of thing is these days, if anyone has ideas.

(https://github.com/gobwas/graceful looks interesting, but has a more complex interface, and also hasn't been committed to in a while.)