diff --git a/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py b/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py index 508f4d7ce..d5807721d 100644 --- a/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py +++ b/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py @@ -164,6 +164,11 @@ def maintain_leases(self) -> None: # that in the event of a badly behaving actor, we can drop messages # and allow the Pub/Sub server to resend them. cutoff = time.time() - self._manager.flow_control.max_lease_duration + + # Add some debugging + for ack_id, item in six.iteritems(leased_messages): + print(f"[Lease manager] ack_id = {ack_id[0:2]}..{ack_id[len(ack_id)-4:len(ack_id)]}; seconds to drop = {round(item.sent_time - cutoff)} ") + to_drop = [ requests.DropRequest(ack_id, item.size, item.ordering_key) for ack_id, item in leased_messages.items()