Skip to content

Commit 01596d4

Browse files
hongalexnoahdietz
authored andcommitted
fix(pubsub): make receipt modack call async (#6335)
* fix(pubsub): make receipt modack call async * dont propagate modack errors * update comment on why errors are not checked
1 parent cf1dbd5 commit 01596d4

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

pubsub/iterator.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,13 @@ func (it *messageIterator) receive(maxToPull int32) ([]*Message, error) {
246246
}
247247
deadline := it.ackDeadline()
248248
it.mu.Unlock()
249-
if len(ackIDs) > 0 {
250-
if !it.sendModAck(ackIDs, deadline) {
251-
return nil, it.err
249+
go func() {
250+
if len(ackIDs) > 0 {
251+
// Don't check the return value of this since modacks are fire and forget,
252+
// meaning errors should not be propagated to the client.
253+
it.sendModAck(ackIDs, deadline)
252254
}
253-
}
255+
}()
254256
return msgs, nil
255257
}
256258

0 commit comments

Comments
 (0)