Skip to content

fix(pubsub): move flow control release to callback completion#9311

Merged
hongalex merged 3 commits intogoogleapis:mainfrom
hongalex:pubsub-fix-flow-control-release
Jan 26, 2024
Merged

fix(pubsub): move flow control release to callback completion#9311
hongalex merged 3 commits intogoogleapis:mainfrom
hongalex:pubsub-fix-flow-control-release

Conversation

@hongalex
Copy link
Member

This moves the flow control release to the end of the user callback rather than to the message doneFunc. This further emphasizes the importance of calling ack and nack within the callback, since calling ack in a goroutine could mean that flow control resources are released too early. This behavior is already documented

Fixes #9309
Internal issue: 322090131

@hongalex hongalex requested a review from shollyman as a code owner January 26, 2024 01:25
@hongalex hongalex requested review from a team January 26, 2024 01:25
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: pubsub Issues related to the Pub/Sub API. labels Jan 26, 2024
@hongalex hongalex enabled auto-merge (squash) January 26, 2024 17:52
@hongalex hongalex merged commit 2b6b0da into googleapis:main Jan 26, 2024
@hongalex hongalex deleted the pubsub-fix-flow-control-release branch May 23, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API. size: m Pull request size is medium.

2 participants