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

Vercel Serverless Function Timeout #8829

Closed
1 task
jln13x opened this issue Oct 13, 2023 · 8 comments · Fixed by #8867
Closed
1 task

Vercel Serverless Function Timeout #8829

jln13x opened this issue Oct 13, 2023 · 8 comments · Fixed by #8867
Labels
- P2: nice to have Not breaking anything but nice to have (priority) pkg: vercel Related to Vercel adapter (scope)

Comments

@jln13x
Copy link

jln13x commented Oct 13, 2023

Astro Info

Astro                    v3.3.0
Node                     v18.17.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   server
Adapter                  @astrojs/vercel/serverless
Integrations             @astrojs/sitemap
                         @astrojs/tailwind
                         @astrojs/react

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Vercel changed the default timeout to 15 seconds at the beginning of October.
Now some of my functions are timing out.

I cant seem to find a way to actually set the maxDuration of my Astro Routes.
My functions are just Astro APIRoutes living under /pages/api/..

What's the expected result?

Being able to set the maxDuration

Link to Minimal Reproducible Example

https://stackblitz.cm/abcd1234

Participation

  • I am willing to submit a pull request for this issue.
@jln13x jln13x changed the title Serverless Function Timeout Vercel Serverless Function Timeout Oct 13, 2023
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Oct 13, 2023
@lilnasy
Copy link
Contributor

lilnasy commented Oct 16, 2023

What causes the responses to take so long?

@lilnasy lilnasy added needs response Issue needs response from OP pkg: vercel Related to Vercel adapter (scope) and removed needs triage Issue needs to be triaged labels Oct 16, 2023
@jln13x
Copy link
Author

jln13x commented Oct 16, 2023

What causes the responses to take so long?

Does it really matter? I could think of multiple use cases where I would to be able to define a longer maxDuration

@lilnasy
Copy link
Contributor

lilnasy commented Oct 16, 2023

I think so. If it is because of some user code, then it might be better handled by user code as well.

@lilnasy lilnasy added the needs repro Issue needs a reproduction label Oct 17, 2023
@github-actions
Copy link
Contributor

Hello @jln13x. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

@jln13x
Copy link
Author

jln13x commented Oct 18, 2023

I think so. If it is because of some user code, then it might be better handled by user code as well.

How would this need a repro?

@lilnasy
Copy link
Contributor

lilnasy commented Oct 18, 2023

If it is not a bug with a repro, it might be a feature request, which could benefit from an explanation of a use case, and how Astro could help.

Do you want to show a custom 504 page when the function times out?

@lilnasy
Copy link
Contributor

lilnasy commented Oct 18, 2023

After looking at Vercel docs, I see what you mean: maxDuration is a vercel option.

We do not have a way to set platform-specific configurations yet, but it is being tracked as a feature request here:

@lilnasy
Copy link
Contributor

lilnasy commented Oct 18, 2023

Since being "granular" is not necessary for maxDuration, it can be implemented right away!

@lilnasy lilnasy added - P2: nice to have Not breaking anything but nice to have (priority) and removed needs response Issue needs response from OP needs repro Issue needs a reproduction labels Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority) pkg: vercel Related to Vercel adapter (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants