Skip to content

Commit 6d54bfc

Browse files
authored
Remove clone in opencensus exporter to ensure task is notified (#405)
In the opencensus span exporter, we call `poll_ready` on the span send channel sender to determine if there is capacity in this channel to send spans. However, the channel sender that we `poll_ready` on is a clone of the original and the clone is dropped shortly after the call to `poll_ready`. This can cause our interest registration to be dropped and the task may not be notified when capacity becomes available. The clone is unnecessarily and we can remove it. Signed-off-by: Alex Leong <[email protected]> Signed-off-by: Alex Leong <[email protected]>
1 parent 5d57d34 commit 6d54bfc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

linkerd/opencensus/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,9 @@ where
180180
ref mut metrics,
181181
..
182182
} => {
183-
let mut sender = sender.clone();
184183
match Self::poll_send_spans(
185184
&mut self.spans,
186-
&mut sender,
185+
sender,
187186
node,
188187
self.max_batch_size,
189188
metrics,

0 commit comments

Comments
 (0)