fix: ACK deadline set for received messages can be too low by plamut · Pull Request #416 · googleapis/python-pubsub

@plamut

When a message is received, the initial MODACK value used should be
the same value currently used by leaser. This makes sure the leaser
will wake up and extend the ACK deadline before the initial one
expires.

@plamut requested a review from a team

May 21, 2021 10:22

@google-cla google-cla bot added the cla: yes

This human has signed the Contributor License Agreement.

label

May 21, 2021

@plamut

If flow_control.max_duration_per_lease_extension is set to too low a
value, it is adjusted to the minimum ACK deadline.

@plamut

@plamut plamut added the do not merge

Indicates a pull request not ready for merge, due to either quality or timing.

label

May 21, 2021

@plamut

The ACK deadline is dynamically being adjusted based on ACK data,
but an updated deadline value must not be used for the new messages
that arrive while the leaser thread is still sleeping.

Doing so could result in the messages' ACK deadlines expiring before
the leaser wakes up and has a chance of extending the deadlines for
these messages. An updated ACK deadline value for new messages is thus
only used when the leaser starts using it, too.

@plamut plamut removed the do not merge

Indicates a pull request not ready for merge, due to either quality or timing.

label

May 21, 2021

jimfulton

@plamut

jimfulton

@plamut

@plamut plamut added the automerge

Merge the pull request once unit tests and other checks pass.

label

May 26, 2021