tordam

A library for peer discovery inside the Tor network
git clone https://git.parazyd.org/tordam
Log | Files | Refs | README | LICENSE

commit ef38cb97dc4fd75a6953b3d75acbede095807db3
parent cafa0dc4bc3eea39112002a70f705130d23db746
Author: parazyd <parazyd@dyne.org>
Date:   Tue, 23 Oct 2018 12:37:21 +0200

Mitigate Redis(Cli) bug by not panicking on the error.

Diffstat:
Mcmd/dam-client/main.go | 7++++++-
Mcontrib/redis.conf | 2+-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/cmd/dam-client/main.go b/cmd/dam-client/main.go @@ -174,7 +174,12 @@ func fetchDirlist(locations []string) ([]string, error) { lib.CheckError(err) for _, i := range nodes { valid, err := lib.RedisCli.HGet(i, "valid").Result() - lib.CheckError(err) + if err != nil { + // Possible RedisCli bug, possible Redis bug. To be investigated. + // Sometimes it returns err, but it's nil and does not say what's + // happening exactly. + continue + } if valid == "1" { dirSlice = append(dirSlice, i) } diff --git a/contrib/redis.conf b/contrib/redis.conf @@ -17,4 +17,4 @@ save 60 10000 rdbcompression yes rdbchecksum yes -stop-writes-on-bgsave-error yes +stop-writes-on-bgsave-error no