Skip to content

Commit

Permalink
fix(pubsub): make receipt modack call async (#6335)
Browse files Browse the repository at this point in the history
* fix(pubsub): make receipt modack call async

* dont propagate modack errors

* update comment on why errors are not checked
  • Loading branch information
hongalex authored Jul 16, 2022
1 parent 085a038 commit d12ca07
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pubsub/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,13 @@ func (it *messageIterator) receive(maxToPull int32) ([]*Message, error) {
}
deadline := it.ackDeadline()
it.mu.Unlock()
if len(ackIDs) > 0 {
if !it.sendModAck(ackIDs, deadline) {
return nil, it.err
go func() {
if len(ackIDs) > 0 {
// Don't check the return value of this since modacks are fire and forget,
// meaning errors should not be propagated to the client.
it.sendModAck(ackIDs, deadline)
}
}
}()
return msgs, nil
}

Expand Down

0 comments on commit d12ca07

Please sign in to comment.