Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pubsub: reverse the padding direction #2478

Closed
wants to merge 2 commits into from
Closed

pubsub: reverse the padding direction #2478

wants to merge 2 commits into from

Conversation

pongad
Copy link
Contributor

@pongad pongad commented Oct 4, 2017

Previously, padding works by sending deadline extension before
messages expire.
Eg, if message expires in 10 seconds, we try to send extension
in 9 seconds.
A problem is with high latency, highly congested, or highly buffered
connections.
If we want the server to expire messages in 10 seconds,
there is no way to set 10 seconds for more of padding.

This commit reverse the padding direction.
Eg, if we want the message to expire in 10 seconds, we send the
extension at 10 seconds, but we ask the server for 11 seconds.
In this way, if we want the padding to be 10 seconds, we just
ask the server for 20 seconds.

This logic only works for streaming pull though,
as streaming pull allows deadline to be changed individually
for each stream.
Consequently, the tests are changed to reflect the new logic
and the relevant tests are disabled for polling pull.

This commit also increases the default padding to 5 seconds,
since high latency has been observed in production.

Fixes #2465.

Previously, padding works by sending deadline extension before
messages expire.
Eg, if message expires in 10 seconds, we try to send extension
in 9 seconds.
A problem is with high latency, highly congested, or highly buffered
connections.
If we want the server to expire messages in 10 seconds,
there is no way to set 10 seconds for more of padding.

This commit reverse the padding direction.
Eg, if we want the message to expire in 10 seconds, we send the
extension at 10 seconds, but we ask the server for 11 seconds.
In this way, if we want the padding to be 10 seconds, we just
ask the server for 20 seconds.

This logic only works for streaming pull though,
as streaming pull allows deadline to be changed individually
for each stream.
Consequently, the tests are changed to reflect the new logic
and the relevant tests are disabled for polling pull.

This commit also increases the default padding to 5 seconds,
since high latency has been observed in production.

Fixes #2465.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 4, 2017
@pongad
Copy link
Contributor Author

pongad commented Oct 4, 2017

@davidtorres @mdietz94

@@ -58,7 +58,7 @@

private static final int INITIAL_ACK_DEADLINE_EXTENSION_SECONDS = 2;
@VisibleForTesting static final Duration PENDING_ACKS_SEND_DELAY = Duration.ofMillis(100);
private static final int MAX_ACK_DEADLINE_EXTENSION_SECS = 10 * 60; // 10m
static final Duration MAX_ACK_DEADLINE = Duration.ofSeconds(600); // 10m

This comment was marked as spam.

@@ -278,8 +279,8 @@ public void stop() {
processOutstandingAckOperations();
}

public void setMessageDeadlineSeconds(int messageDeadlineSeconds) {
this.messageDeadlineSeconds.set(messageDeadlineSeconds);
public void setMessageDeadline(Duration dur) {

This comment was marked as spam.


/*
We define 3 forms of deadline:
1. intendedDeadline: The amount of time we take to process a message.

This comment was marked as spam.

@pongad
Copy link
Contributor Author

pongad commented Oct 31, 2017

pubsub team is going with a different solution. closing this.

@pongad pongad closed this Oct 31, 2017
@pongad pongad deleted the pubsub-dup branch October 31, 2017 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants