-
Notifications
You must be signed in to change notification settings - Fork 110
api, metrics, network: check caps when deciding on next peer for a chunk #1749
Changes from 1 commit
7ef600f
b278c14
c1de0f4
dcdbc3d
8b5ff92
ecf0094
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,7 +121,7 @@ func datadirDiskUsage(path string, d time.Duration) { | |
for range time.Tick(d) { | ||
bytes, err := dirSize(path) | ||
if err != nil { | ||
log.Warn("cannot get disk space", "err", err) | ||
log.Trace("cannot get disk space", "err", err) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This warning is annoying when we hit LevelDB during compaction, and it is mostly useless in our monitoring system, therefore I am reducing its level. |
||
} | ||
|
||
metrics.GetOrRegisterGauge("datadir.usage", nil).Update(bytes) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ import ( | |
"github.com/ethereum/go-ethereum/rpc" | ||
"github.com/ethersphere/swarm/chunk" | ||
"github.com/ethersphere/swarm/network" | ||
"github.com/ethersphere/swarm/network/stream/v2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, there is a circular dependency in tests reported by linter. Retrieval is needed in stream tests, and here stream is imported. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, so I will just hard-code the name of the protocol. This is not something that should change often. OK? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is OK. |
||
"github.com/ethersphere/swarm/network/timeouts" | ||
"github.com/ethersphere/swarm/p2p/protocols" | ||
"github.com/ethersphere/swarm/spancontext" | ||
|
@@ -231,6 +232,10 @@ func (r *Retrieval) findPeer(ctx context.Context, req *storage.Request) (retPeer | |
return true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, this can be removed. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reverted it back, because we change the check for capabilities for |
||
} | ||
|
||
if !p.HasCap(stream.Spec.Name) { | ||
return true | ||
} | ||
|
||
// do not send request back to peer who asked us. maybe merge with SkipPeer at some point | ||
if bytes.Equal(req.Origin.Bytes(), id.Bytes()) { | ||
return true | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Independent of the
findPeer - RequestFromPeers
bug, but nonetheless a nice-to-have fix, so thatDeliveriesFromPeers
debug API works.