Skip to content

Commit

Permalink
debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfung-dydx committed Aug 9, 2024
1 parent 32db698 commit 7abe7ed
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions protocol/streaming/full_node_streaming_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ func (sm *FullNodeStreamingManagerImpl) Subscribe(
func (sm *FullNodeStreamingManagerImpl) removeSubscription(
subscriptionIdToRemove uint32,
) {
sm.logger.Info(
fmt.Sprintf("starting to remove subscription %+v", subscriptionIdToRemove),
)
subscription := sm.orderbookSubscriptions[subscriptionIdToRemove]
if subscription == nil {
return
Expand Down Expand Up @@ -486,6 +489,9 @@ func (sm *FullNodeStreamingManagerImpl) FlushStreamUpdatesWithLock() {
subscriptionUpdates[id] = append(subscriptionUpdates[id], update)
}
}
sm.logger.Info(
fmt.Sprintf("flushing updates of length %+v", len(sm.streamUpdateCache)),
)

// Non-blocking send updates through subscriber's buffered channel.
// If the buffer is full, drop the subscription.
Expand All @@ -497,7 +503,9 @@ func (sm *FullNodeStreamingManagerImpl) FlushStreamUpdatesWithLock() {
)
select {
case subscription.updatesChannel <- updates:
sm.logger.Info(fmt.Sprintf("emitting update through channel now len %+v", len(subscription.updatesChannel)))
default:
sm.logger.Info(fmt.Sprintf("buffer full removing id %+v", id))
idsToRemove = append(idsToRemove, id)
}
}
Expand Down

0 comments on commit 7abe7ed

Please sign in to comment.