Skip to content

Commit af0d9c0

Browse files
Merge pull request #3037 from ipfs/feat/detect-issue-3032
dht: add in code to detect and diagnose #3032
2 parents 241bfce + ce6782a commit af0d9c0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

routing/dht/routing.go

+11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package dht
33
import (
44
"bytes"
55
"fmt"
6+
"runtime"
67
"sync"
78
"time"
89

@@ -380,6 +381,16 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key key.Key,
380381
_, err := query.Run(ctx, peers)
381382
if err != nil {
382383
log.Debugf("Query error: %s", err)
384+
// Special handling for issue: https://github.com/ipfs/go-ipfs/issues/3032
385+
if fmt.Sprint(err) == "<nil>" {
386+
log.Error("reproduced bug 3032:")
387+
log.Errorf("Errors type information: %#v", err)
388+
log.Errorf("go version: %s", runtime.Version())
389+
log.Error("please report this information to: https://github.com/ipfs/go-ipfs/issues/3032")
390+
391+
// replace problematic error with something that won't crash the daemon
392+
err = fmt.Errorf("<nil>")
393+
}
383394
notif.PublishQueryEvent(ctx, &notif.QueryEvent{
384395
Type: notif.QueryError,
385396
Extra: err.Error(),

0 commit comments

Comments
 (0)