Skip to content

Commit

Permalink
rename RawTracer's DroppedInSubscribe into UndeliverableMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMure authored and aschmahmann committed Jul 13, 2021
1 parent 9be1c59 commit 65f48fb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion gossip_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (gt *gossipTracer) DuplicateMessage(msg *Message) {}
func (gt *gossipTracer) RecvRPC(rpc *RPC) {}
func (gt *gossipTracer) SendRPC(rpc *RPC, p peer.ID) {}
func (gt *gossipTracer) DropRPC(rpc *RPC, p peer.ID) {}
func (gt *gossipTracer) DroppedInSubscribe(msg *Message) {}
func (gt *gossipTracer) UndeliverableMessage(msg *Message) {}

func (gt *gossipTracer) ThrottlePeer(p peer.ID) {
gt.Lock()
Expand Down
2 changes: 1 addition & 1 deletion peer_gater.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,4 +450,4 @@ func (pg *peerGater) SendRPC(rpc *RPC, p peer.ID) {}

func (pg *peerGater) DropRPC(rpc *RPC, p peer.ID) {}

func (pg *peerGater) DroppedInSubscribe(msg *Message) {}
func (pg *peerGater) UndeliverableMessage(msg *Message) {}
2 changes: 1 addition & 1 deletion pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ func (p *PubSub) notifySubs(msg *Message) {
select {
case f.ch <- msg:
default:
p.tracer.DroppedInSubscribe(msg)
p.tracer.UndeliverableMessage(msg)
log.Infof("Can't deliver message to subscription for topic %s; subscriber too slow", topic)
}
}
Expand Down
2 changes: 1 addition & 1 deletion score.go
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ func (ps *peerScore) SendRPC(rpc *RPC, p peer.ID) {}

func (ps *peerScore) DropRPC(rpc *RPC, p peer.ID) {}

func (ps *peerScore) DroppedInSubscribe(msg *Message) {}
func (ps *peerScore) UndeliverableMessage(msg *Message) {}

// message delivery records
func (d *messageDeliveries) getRecord(id string) *deliveryRecord {
Expand Down
12 changes: 6 additions & 6 deletions tag_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ func (t *tagTracer) RejectMessage(msg *Message, reason string) {
}
}

func (t *tagTracer) RemovePeer(peer.ID) {}
func (t *tagTracer) ThrottlePeer(p peer.ID) {}
func (t *tagTracer) RecvRPC(rpc *RPC) {}
func (t *tagTracer) SendRPC(rpc *RPC, p peer.ID) {}
func (t *tagTracer) DropRPC(rpc *RPC, p peer.ID) {}
func (t *tagTracer) DroppedInSubscribe(msg *Message) {}
func (t *tagTracer) RemovePeer(peer.ID) {}
func (t *tagTracer) ThrottlePeer(p peer.ID) {}
func (t *tagTracer) RecvRPC(rpc *RPC) {}
func (t *tagTracer) SendRPC(rpc *RPC, p peer.ID) {}
func (t *tagTracer) DropRPC(rpc *RPC, p peer.ID) {}
func (t *tagTracer) UndeliverableMessage(msg *Message) {}
8 changes: 4 additions & 4 deletions trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ type RawTracer interface {
SendRPC(rpc *RPC, p peer.ID)
// DropRPC is invoked when an outbound RPC is dropped, typically because of a queue full.
DropRPC(rpc *RPC, p peer.ID)
// DroppedInSubscribe is invoked when the consumer of Subscribe is not reading messages fast enough and
// UndeliverableMessage is invoked when the consumer of Subscribe is not reading messages fast enough and
// the pressure release mechanism trigger, dropping messages.
DroppedInSubscribe(msg *Message)
UndeliverableMessage(msg *Message)
}

// pubsub tracer details
Expand Down Expand Up @@ -328,13 +328,13 @@ func (t *pubsubTracer) DropRPC(rpc *RPC, p peer.ID) {
t.tracer.Trace(evt)
}

func (t *pubsubTracer) DroppedInSubscribe(msg *Message) {
func (t *pubsubTracer) UndeliverableMessage(msg *Message) {
if t == nil {
return
}

for _, tr := range t.raw {
tr.DroppedInSubscribe(msg)
tr.UndeliverableMessage(msg)
}
}

Expand Down

0 comments on commit 65f48fb

Please sign in to comment.