-
Notifications
You must be signed in to change notification settings - Fork 204
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
Feature request: Pass retry count to task queue function #1178
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
For reference, we may want to expose any of these that seem useful: https://cloud.google.com/tasks/docs/creating-http-target-tasks#handler |
To know if an attempt is the last attempt, we must also know how For example, suppose I have a function with If tasks always follow the most recent |
This feature has been formally proposed internally. |
Any update on this after 5 months? It's a bit of a joke that I have to maintain a fork of the package just to have this feature. |
I'm a bit tired of waiting Firebase to implement new things. Everything takes ages. I used to be excited by the Firebase Summit, but it's getting ever more boring year after year. Note that I'm not blaming the team, it's probably just lack of investment from Google, but it's sad anyway. |
I'd really love to see this feature as well. Without the extra context that is normally provided in the headers, one really has limited control over the tasks. It is impossible now to determine if the tasks will be retried again or if we have to move it to some dead letter storage. Is there anything we can do to help @inlined ? |
@marvin-kolja You're right. I'm closing. |
I've tweeted about this and @mbleigh instructed me to file a feature request in the repo, so:
I know that Cloud Tasks sends the HTTP request with a header
X-CloudTasks-TaskRetryCount
. I need to have that information in the Firebase task queue function so I can handle the last attempt differently, e.g.:Maybe consider exposing the raw request just as we can access
context.rawRequest
in the callable functions.As @inlined said in this tweet, he is not a fan of exposing the raw request because it would be harder to test. On the other hand, maybe you can expose the retry count as a first-class parameter like
context.retryCount
, but still exposecontext.rawRequest
as an escape hatch to be used while a first-class parameter doesn't exist. For example, right now I'd be able to usecontext.rawRequest.headers.get('x-cloudtasks-taskretrycount')
until a better parameter is implemented.If such an escape hatch doesn't exist, people like me either have to wait until the team expose the desired parameter or have to rewrite to use the Cloud Tasks client directly. Using
context.rawRequest
temporarily would be a much easier workaround even if it's not documented or easy to test.The text was updated successfully, but these errors were encountered: