提交 ce6782a2 作者: Jeromy

dht: add in code to detect and diagnose #3032

License: MIT
Signed-off-by: 's avatarJeromy <why@ipfs.io>
上级 241bfcee
...@@ -3,6 +3,7 @@ package dht ...@@ -3,6 +3,7 @@ package dht
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"runtime"
"sync" "sync"
"time" "time"
...@@ -380,6 +381,16 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key key.Key, ...@@ -380,6 +381,16 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key key.Key,
_, err := query.Run(ctx, peers) _, err := query.Run(ctx, peers)
if err != nil { if err != nil {
log.Debugf("Query error: %s", err) log.Debugf("Query error: %s", err)
// Special handling for issue: https://github.com/ipfs/go-ipfs/issues/3032
if fmt.Sprint(err) == "<nil>" {
log.Error("reproduced bug 3032:")
log.Errorf("Errors type information: %#v", err)
log.Errorf("go version: %s", runtime.Version())
log.Error("please report this information to: https://github.com/ipfs/go-ipfs/issues/3032")
// replace problematic error with something that won't crash the daemon
err = fmt.Errorf("<nil>")
}
notif.PublishQueryEvent(ctx, &notif.QueryEvent{ notif.PublishQueryEvent(ctx, &notif.QueryEvent{
Type: notif.QueryError, Type: notif.QueryError,
Extra: err.Error(), Extra: err.Error(),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论