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

Make ackDeadline editable #6

Closed
stephenplusplus opened this issue Dec 12, 2017 · 3 comments
Closed

Make ackDeadline editable #6

stephenplusplus opened this issue Dec 12, 2017 · 3 comments
Assignees
Labels
api: pubsub Issues related to the googleapis/nodejs-pubsub API. help wanted We'd love to have community involvement on this issue. priority: p2 Moderately-important priority. Fix may not be included in next release. triaged for GA type: enhancement

Comments

@stephenplusplus
Copy link
Contributor

This is a request originally from @mkamioner in this PR.

Love the new changes, but I miss the ability to specify my ackDeadline -- Sometimes I have processes with long running jobs and I want to be able to change it in once place

@stephenplusplus stephenplusplus added help wanted We'd love to have community involvement on this issue. priority: p2 Moderately-important priority. Fix may not be included in next release. type: enhancement labels Dec 12, 2017
@baronfel
Copy link
Contributor

baronfel commented Jan 5, 2018

Agree on this. We have long-running processes that we dynamically refresh the ackDeadline on a timer based on a rolling average of job completion, and we lost this capability on this version.

@rossj
Copy link

rossj commented Jan 9, 2018

I also have long-running jobs, and the current approach will start with an ackDeadline of 10 seconds and renew this deadline at a random interval somewhere between 0 and 0.9 times the current deadline (0-9 seconds initially). This is too frequent for my taste, so for now I've overridden the starting ackDeadline and the histogram object to maintain a constant ackDeadline of 5 minutes.

const sub = client.subscription(name);
sub.ackDeadline = 5 * 60 * 1000;
sub.histogram = {
    add: () => { },
    percentile: () => sub.ackDeadline
};

One can further monkey patch the subscription's setLeaseTimeout_ function in order to change the lease renewal timeout as desired. For instance, I've set it to be a constant 4 minute renewal timeout.

@callmehiphop
Copy link
Contributor

callmehiphop commented Jan 15, 2019

We should have a release coming up in the next several days that will include the ability to manually set ack deadlines.

const subscription = topic.subscription('my-sub', {ackDeadline: 20}); // 20 seconds

@google-cloud-label-sync google-cloud-label-sync bot added the api: pubsub Issues related to the googleapis/nodejs-pubsub API. label Jan 31, 2020
@yoshi-automation yoshi-automation removed the 🚨 This issue needs some love. label Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/nodejs-pubsub API. help wanted We'd love to have community involvement on this issue. priority: p2 Moderately-important priority. Fix may not be included in next release. triaged for GA type: enhancement
Projects
None yet
Development

No branches or pull requests

7 participants