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

Fix Function Deployment Polling (Handle 404 After Create) #1421

Open
Bhatt21 opened this issue Jan 31, 2025 · 2 comments
Open

Fix Function Deployment Polling (Handle 404 After Create) #1421

Bhatt21 opened this issue Jan 31, 2025 · 2 comments

Comments

@Bhatt21
Copy link

Bhatt21 commented Jan 31, 2025

Currently, when deploying a Cloud Function using create(), we sometimes see a 404 error when immediately trying to get() the function. This happens because the function creation process in Cloud Functions v1 is asynchronous—create() returns before the function is fully registered, causing transient 404 responses.
it happens here

I have a fix ready that adds proper polling logic:

Retry on 404 (since it means the function is not yet recognized).

Handle everything else as usual

Should we continue using Cloud Functions v1, or should we migrate to Cloud Functions v2?
In v2, we can poll the long-running Operation instead of polling get(), but moving to v2 might require more changes.
Would love input on whether we should stay with v1 and apply the polling fix, or consider moving to v2.

Note** Almost every time, get() fails with a 404 unless a manual delay is added.

Side Note: Lithops is awesome!

@JosepSampe
Copy link
Member

Hi @Bhatt21 For now we are going to keep v1. Feel free to open a PR and include the fix

@Bhatt21
Copy link
Author

Bhatt21 commented Feb 20, 2025

sure!

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