Skip to content

pubsub: update context handling in tracer end calls #3562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pubsub/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func newSendBatcher(ctx context.Context, t *Topic, dt driver.Topic, opts *batche
dms := items.([]*driver.Message)
err := retry.Call(ctx, gax.Backoff{}, dt.IsRetryable, func() (err error) {
ctx2, span := t.tracer.Start(ctx, "driver.Topic.SendBatch")
defer func() { t.tracer.End(ctx, span, err) }()
defer func() { t.tracer.End(ctx2, span, err) }()
return dt.SendBatch(ctx2, dms)
})
if err != nil {
Expand Down Expand Up @@ -648,7 +648,7 @@ func (s *Subscription) getNextBatch(nMessages int) chan msgsOrError {
err := retry.Call(ctx, gax.Backoff{}, s.driver.IsRetryable, func() error {
var err error
ctx2, span := s.tracer.Start(ctx, "driver.Subscription.ReceiveBatch")
defer func() { s.tracer.End(ctx, span, err) }()
defer func() { s.tracer.End(ctx2, span, err) }()
msgs, err = s.driver.ReceiveBatch(ctx2, curMaxMessagesInBatch)
return err
})
Expand Down
Loading