Skip to content

pubsub: reverse the padding direction - #2478

Closed
pongad wants to merge 2 commits into
googleapis:masterfrom
pongad:pubsub-dup
Closed

pubsub: reverse the padding direction#2478
pongad wants to merge 2 commits into
googleapis:masterfrom
pongad:pubsub-dup

Conversation

@pongad

@pongad pongad commented Oct 4, 2017

Copy link
Copy Markdown
Contributor

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

pongad commented Oct 4, 2017

Copy link
Copy Markdown
Contributor Author

@davidtorres @mdietz94

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.


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

pongad commented Oct 31, 2017

Copy link
Copy Markdown
Contributor Author

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
chingor13 pushed a commit that referenced this pull request Feb 20, 2026
…plugin to v3.1.2 (#2478)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [org.apache.maven.plugins:maven-deploy-plugin](https://maven.apache.org/plugins/) | `3.1.1` -> `3.1.2` | [![age](https://developer.mend.io/api/mc/badges/age/maven/org.apache.maven.plugins:maven-deploy-plugin/3.1.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.apache.maven.plugins:maven-deploy-plugin/3.1.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.apache.maven.plugins:maven-deploy-plugin/3.1.1/3.1.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.apache.maven.plugins:maven-deploy-plugin/3.1.1/3.1.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/java-bigquerystorage).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjMyMS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
chingor13 pushed a commit that referenced this pull request Mar 30, 2026
…37.0 (#2478)

* chore(deps): update dependency com.google.cloud:libraries-bom to v26.37.0

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
benjaminp pushed a commit to benjaminp/google-cloud-java that referenced this pull request Jul 13, 2026
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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