-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
added
the
cla: yes
This human has signed the Contributor License Agreement.
label
Oct 4, 2017
@@ -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.
This comment was marked as spam.
Sorry, something went wrong.
@@ -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.
This comment was marked as spam.
Sorry, something went wrong.
|
||
/* | ||
We define 3 forms of deadline: | ||
1. intendedDeadline: The amount of time we take to process a message. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
pubsub team is going with a different solution. closing this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.