Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ class MessageDispatcher {
private final LinkedBlockingQueue<String> pendingNacks = new LinkedBlockingQueue<>();
private final LinkedBlockingQueue<String> pendingReceipts = new LinkedBlockingQueue<>();

// The deadline should be set before use. Here, set it to something unreasonable,
// so we fail loudly if we mess up.
private final AtomicInteger messageDeadlineSeconds = new AtomicInteger(60);
// Start the deadline at the minimum ack deadline so messages which arrive before this is
// updated will not have a long ack deadline.
private final AtomicInteger messageDeadlineSeconds =
new AtomicInteger(Subscriber.MIN_ACK_DEADLINE_SECONDS);
private final AtomicBoolean extendDeadline = new AtomicBoolean(true);
private final Lock jobLock;
private ScheduledFuture<?> backgroundJob;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ public Void apply(UnaryCallSettings.Builder<?, ?> settingsBuilder) {
streamingSubscriberConnections = new ArrayList<StreamingSubscriberConnection>(numPullers);

// We regularly look up the distribution for a good subscription deadline.
// So we seed the distribution with something reasonable to start with.
// So we seed the distribution with the minimum value to start with.
// Distribution is percentile-based, so this value will eventually lose importance.
ackLatencyDistribution.record(60);
ackLatencyDistribution.record(MIN_ACK_DEADLINE_SECONDS);
}

/**
Expand Down