mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
swarm/network: Remove useless span remember
This commit is contained in:
parent
3f3f6708dc
commit
241119a970
2 changed files with 0 additions and 26 deletions
|
|
@ -209,22 +209,11 @@ type ChunkDeliveryMsgSyncing ChunkDeliveryMsg
|
||||||
|
|
||||||
// TODO: Fix context SNAFU
|
// TODO: Fix context SNAFU
|
||||||
func (d *Delivery) handleChunkDeliveryMsg(ctx context.Context, sp *Peer, req *ChunkDeliveryMsg) error {
|
func (d *Delivery) handleChunkDeliveryMsg(ctx context.Context, sp *Peer, req *ChunkDeliveryMsg) error {
|
||||||
// var osp opentracing.Span
|
|
||||||
// ctx, osp = spancontext.StartSpan(
|
|
||||||
// ctx,
|
|
||||||
// "chunk.delivery")
|
|
||||||
|
|
||||||
spanId := fmt.Sprintf("request.%v.%v", sp.ID(), req.Addr)
|
|
||||||
span, spanOk := sp.spans.Load(spanId)
|
|
||||||
sp.spans.Delete(spanId)
|
|
||||||
|
|
||||||
processReceivedChunksCount.Inc(1)
|
processReceivedChunksCount.Inc(1)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
//defer osp.Finish()
|
//defer osp.Finish()
|
||||||
if spanOk {
|
|
||||||
defer span.(opentracing.Span).Finish()
|
|
||||||
}
|
|
||||||
|
|
||||||
req.peer = sp
|
req.peer = sp
|
||||||
err := d.chunkStore.Put(ctx, storage.NewChunk(req.Addr, req.SData))
|
err := d.chunkStore.Put(ctx, storage.NewChunk(req.Addr, req.SData))
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,6 @@ type Peer struct {
|
||||||
// on creating a new client in offered hashes handler.
|
// on creating a new client in offered hashes handler.
|
||||||
clientParams map[Stream]*clientParams
|
clientParams map[Stream]*clientParams
|
||||||
quit chan struct{}
|
quit chan struct{}
|
||||||
spans sync.Map
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type WrappedPriorityMsg struct {
|
type WrappedPriorityMsg struct {
|
||||||
|
|
@ -83,16 +82,10 @@ func NewPeer(peer *protocols.Peer, streamer *Registry) *Peer {
|
||||||
clients: make(map[Stream]*client),
|
clients: make(map[Stream]*client),
|
||||||
clientParams: make(map[Stream]*clientParams),
|
clientParams: make(map[Stream]*clientParams),
|
||||||
quit: make(chan struct{}),
|
quit: make(chan struct{}),
|
||||||
spans: sync.Map{},
|
|
||||||
}
|
}
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
go p.pq.Run(ctx, func(i interface{}) {
|
go p.pq.Run(ctx, func(i interface{}) {
|
||||||
wmsg := i.(WrappedPriorityMsg)
|
wmsg := i.(WrappedPriorityMsg)
|
||||||
// defer p.spans.Delete(wmsg.Context)
|
|
||||||
// sp, ok := p.spans.Load(wmsg.Context)
|
|
||||||
// if ok {
|
|
||||||
// defer sp.(opentracing.Span).Finish()
|
|
||||||
// }
|
|
||||||
err := p.Send(wmsg.Context, wmsg.Msg)
|
err := p.Send(wmsg.Context, wmsg.Msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Message send error, dropping peer", "peer", p.ID(), "err", err)
|
log.Error("Message send error, dropping peer", "peer", p.ID(), "err", err)
|
||||||
|
|
@ -166,14 +159,6 @@ func (p *Peer) Deliver(ctx context.Context, chunk storage.Chunk, priority uint8,
|
||||||
func (p *Peer) SendPriority(ctx context.Context, msg interface{}, priority uint8, traceId string) error {
|
func (p *Peer) SendPriority(ctx context.Context, msg interface{}, priority uint8, traceId string) error {
|
||||||
defer metrics.GetOrRegisterResettingTimer(fmt.Sprintf("peer.sendpriority_t.%d", priority), nil).UpdateSince(time.Now())
|
defer metrics.GetOrRegisterResettingTimer(fmt.Sprintf("peer.sendpriority_t.%d", priority), nil).UpdateSince(time.Now())
|
||||||
metrics.GetOrRegisterCounter(fmt.Sprintf("peer.sendpriority.%d", priority), nil).Inc(1)
|
metrics.GetOrRegisterCounter(fmt.Sprintf("peer.sendpriority.%d", priority), nil).Inc(1)
|
||||||
if traceId != "" {
|
|
||||||
var sp opentracing.Span
|
|
||||||
ctx, sp = spancontext.StartSpan(
|
|
||||||
ctx,
|
|
||||||
traceId,
|
|
||||||
)
|
|
||||||
p.spans.Store(traceId, sp)
|
|
||||||
}
|
|
||||||
wmsg := WrappedPriorityMsg{
|
wmsg := WrappedPriorityMsg{
|
||||||
Context: ctx,
|
Context: ctx,
|
||||||
Msg: msg,
|
Msg: msg,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue