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

ISR page stops revalidating if the page data collection takes longer than the specified staticPageGenerationTimeout #36672

Open
1 task done
la55u opened this issue May 4, 2022 · 0 comments
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team.

Comments

@la55u
Copy link

la55u commented May 4, 2022

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT Wed Apr 20 15:37:53 UTC 2022
Binaries:
  Node: 16.14.0
  npm: 8.5.3
  Yarn: 1.22.10
  pnpm: N/A
Relevant packages:
  next: 12.1.6
  react: 18.1.0
  react-dom: 18.1.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

The problem happens when there is getStaticProps with revalidate on a page and a request inside it takes longer than expected to finish. For example this delay can be caused by a server that occasionally drops requests and the timeout on that server is set to a very large number e.g. one day.
In that case getStaticProps will not revalidate the page until this very long request finishes even after subsequent refresh attempts on the page and even after the timeout defined by staticPageGenerationTimeout in config was reached. This can cause problems when the timeout on the faulty server is set to a high number and the request takes longer to finish than the specified staticPageGenerationTimeout. For the user it seems the revalidation simply does not work.

Reproduction:
https://github.com/la55u/next-isr-demo

Expected Behavior

In the reproduction, at step 6, the displayed value should be 3.
The reason I think it should work this way is because staticPageGenerationTimeout (10sec) was reached, meaning it should kill all ongoing processes inside getStaticProps and "start over" on the next refresh attempt.

To Reproduce

  1. clone the repo
  2. npm run build && npm run start
  3. open the page, first you see 1 (OK)
  4. wait 3 seconds, hit refresh, you should see 1 (OK) -> revalidate kicks in
  5. wait 3 seconds, hit refresh, you should see 2 (OK) -> revalidate kicks in
  6. wait 3 seconds, hit refresh, you should see 2 (NOT OK)
  7. no more revalidate if you refresh, the page is stuck forever! (until the timeout from the failed request ends)
@la55u la55u added the bug Issue was opened via the bug report template. label May 4, 2022
@la55u la55u changed the title ISR pages stops revalidating if the page data collection takes longer than the specified staticPageGenerationTimeout ISR page stops revalidating if the page data collection takes longer than the specified staticPageGenerationTimeout May 4, 2022
@github-actions github-actions bot added the linear: next Confirmed issue that is tracked by the Next.js team. label Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. linear: next Confirmed issue that is tracked by the Next.js team.
Projects
None yet
Development

No branches or pull requests

3 participants