mirror of
https://github.com/tailscale/tailscale.git
synced 2024-12-04 23:45:34 +00:00
net/netmon: improve panic reporting from #14202
I was hoping we'd catch an example input quickly, but the reporter had rebooted their machine and it is no longer exhibiting the behavior. As such this code may be sticking around quite a bit longer and we might encounter other errors, so include the panic in the log entry. Updates #14201 Updates #14202 Updates golang/go#70528 Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
parent
788121f475
commit
4d33f30f91
@ -58,9 +58,12 @@ func (m *darwinRouteMon) Receive() (message, error) {
|
||||
}
|
||||
msgs, err := func() (msgs []route.Message, err error) {
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
// TODO(raggi,#14201): remove once we've got a fix from
|
||||
// golang/go#70528.
|
||||
msg := recover()
|
||||
if msg != nil {
|
||||
msgs = nil
|
||||
err = fmt.Errorf("panic parsing route message")
|
||||
err = fmt.Errorf("panic in route.ParseRIB: %s", msg)
|
||||
}
|
||||
}()
|
||||
return route.ParseRIB(route.RIBTypeRoute, m.buf[:n])
|
||||
|
Loading…
Reference in New Issue
Block a user