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

Add option to set dispatch_deadline for the task? #177

Open
aaajeetee opened this issue Mar 18, 2025 · 2 comments
Open

Add option to set dispatch_deadline for the task? #177

aaajeetee opened this issue Mar 18, 2025 · 2 comments

Comments

@aaajeetee
Copy link
Contributor

aaajeetee commented Mar 18, 2025

According to the documentation, the Cloud Task has a dispatch_deadline option. Default (for HTTP tasks) is 10 minutes.

In this package, I see no option to set this option. I do see that this config option was deleted in the past, but could not really find out why.

The reason I open this issue: I just got a "DEADLINE_EXCEEDED" error on my task, which was running longer than 10 minutes. The client that was called runs on cloud run and has a timeout of 30 minutes. This timeout was not hit.

Can you clarify why the dispatch_deadline was removed and how I can set this option with the current version? I would like to tell google that my task runs longer than 10 minutes, but I cannot seem to find the possibility to do so (I would expect it somewhere in CloudTasksQueue::pushToCloudTasks()).

Thanks in advance for your answer!

@marickvantuil
Copy link
Member

marickvantuil commented Apr 3, 2025

Hey, I think I removed that option because I thought it no longer necessary, because job timeouts could already be handeled by the $timeout option. But now I understand changing the dispatch_deadline is in fact necessary if tasks need to run longer than the default 10 minutes. I think somewhere next week/in the coming weeks I can add it back, but feel free to make a PR if you need it faster!

@aaajeetee
Copy link
Contributor Author

aaajeetee commented Apr 4, 2025

Thank you for your reply. To be honest, I have kind of hacked it into our project where we needed it, so I'm no in that big of a hurry.
Also, I'm wondering if you are thinking of just adding the config option again, or perhaps want to make this a bit more flexible, so it can be set per job perhaps? A bit like how the handler url or headers can be set per job.

On the other hand, a (high value) config works for all the jobs of course, but I can imagine that some might want to set this timeout per job. For me, using 1 (high value) config value works, because my endpoint is a cloudrun service, which has a (separate) timeout.

I'm more than happy to make a PR for this, but I don't have a lot of time in the next few weeks (either).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants