mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/swarm/swarm-smoke: address PR comments
This commit is contained in:
parent
63d18ed95d
commit
9a09a0399b
2 changed files with 7 additions and 6 deletions
|
|
@ -150,7 +150,7 @@ var (
|
||||||
SwarmStoreCacheCapacity = cli.UintFlag{
|
SwarmStoreCacheCapacity = cli.UintFlag{
|
||||||
Name: "store.cache.size",
|
Name: "store.cache.size",
|
||||||
Usage: "Number of recent chunks cached in memory",
|
Usage: "Number of recent chunks cached in memory",
|
||||||
EnvVar: SWARM_ENV_STORE_CACHE_CAPACITY,
|
EnvVar: SwarmEnvStoreCacheCapacity,
|
||||||
Value: 10000,
|
Value: 10000,
|
||||||
}
|
}
|
||||||
SwarmCompressedFlag = cli.BoolFlag{
|
SwarmCompressedFlag = cli.BoolFlag{
|
||||||
|
|
|
||||||
|
|
@ -101,8 +101,8 @@ outer:
|
||||||
case q <- struct{}{}:
|
case q <- struct{}{}:
|
||||||
go func() {
|
go func() {
|
||||||
var start time.Time
|
var start time.Time
|
||||||
inner:
|
done := false
|
||||||
for {
|
for !done {
|
||||||
log.Info("trying to retrieve hash", "hash", v.hash)
|
log.Info("trying to retrieve hash", "hash", v.hash)
|
||||||
idx := 1 + rand.Intn(len(hosts)-1)
|
idx := 1 + rand.Intn(len(hosts)-1)
|
||||||
ruid := uuid.New()[:8]
|
ruid := uuid.New()[:8]
|
||||||
|
|
@ -111,9 +111,10 @@ outer:
|
||||||
// catch the timeout, but also allow this retry logic
|
// catch the timeout, but also allow this retry logic
|
||||||
err := fetch(v.hash, httpEndpoint(hosts[idx]), v.digest, ruid, "")
|
err := fetch(v.hash, httpEndpoint(hosts[idx]), v.digest, ruid, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue inner
|
log.Error("error fetching hash", "err", err)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
break inner
|
done = true
|
||||||
}
|
}
|
||||||
metrics.GetOrRegisterResettingTimer("sliding-window.single.fetch-time", nil).UpdateSince(start)
|
metrics.GetOrRegisterResettingTimer("sliding-window.single.fetch-time", nil).UpdateSince(start)
|
||||||
d <- struct{}{}
|
d <- struct{}{}
|
||||||
|
|
@ -123,7 +124,7 @@ outer:
|
||||||
break task
|
break task
|
||||||
case <-timeoutC:
|
case <-timeoutC:
|
||||||
errored = true
|
errored = true
|
||||||
log.Error("error retrieving hash. timeout", "hash idx", i, "err", err)
|
log.Error("error retrieving hash. timeout", "hash idx", i)
|
||||||
metrics.GetOrRegisterCounter("sliding-window.single.error", nil).Inc(1)
|
metrics.GetOrRegisterCounter("sliding-window.single.error", nil).Inc(1)
|
||||||
break outer
|
break outer
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue