ISR page stops revalidating if the page data collection takes longer than the specified staticPageGenerationTimeout
#36672
Labels
bug
Issue was opened via the bug report template.
linear: next
Confirmed issue that is tracked by the Next.js team.
Verify canary release
Provide environment information
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
withrevalidate
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 bystaticPageGenerationTimeout
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 specifiedstaticPageGenerationTimeout
. 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 insidegetStaticProps
and "start over" on the next refresh attempt.To Reproduce
npm run build
&&npm run start
1
(OK)1
(OK) -> revalidate kicks in2
(OK) -> revalidate kicks in2
(NOT OK)The text was updated successfully, but these errors were encountered: