Skip to content

Commit cee9c22

Browse files
authored
add some debugging to leaser
1 parent fd2840c commit cee9c22

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • google/cloud/pubsub_v1/subscriber/_protocol

google/cloud/pubsub_v1/subscriber/_protocol/leaser.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ def maintain_leases(self):
142142
# that in the event of a badly behaving actor, we can drop messages
143143
# and allow the Pub/Sub server to resend them.
144144
cutoff = time.time() - self._manager.flow_control.max_lease_duration
145+
146+
# Add some debugging
147+
for ack_id, item in six.iteritems(leased_messages):
148+
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)} ")
149+
145150
to_drop = [
146151
requests.DropRequest(ack_id, item.size, item.ordering_key)
147152
for ack_id, item in six.iteritems(leased_messages)

0 commit comments

Comments
 (0)