[Fizz] prevent reentrant finishedTask from calling completeAll multiple times#36287
Merged
gnoff merged 1 commit intofacebook:mainfrom Apr 16, 2026
Merged
Conversation
…le times It is possible for the fallback tasks from a Suspense boundary to trigger an early completeAll() call which is later repeated due to finishedTask reentrancy. For node.js in particular this might be problematic since we invoke a callback on each completeAll() call but in general it just isn't the right semantics since the call is running slightly earlier than the completion of the last finishedTask invocation. This change ensures that any reentrant finishedTask calls (due to soft aborting fallback tasks) omit the completeAll() call by temporarily incrementing the total pending tasks.
|
Comparing: 56922cf...6285505 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
unstubbable
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It is possible for the fallback tasks from a Suspense boundary to trigger an early
completeAllcall which is later repeated due tofinishedTaskreentrancy. For node.js in particular this might be problematic since we invoke a callback on eachcompleteAllcall but in general it just isn't the right semantics since the call is running slightly earlier than the completion of the lastfinishedTaskinvocation. This change ensures that any reentrantfinishedTaskcalls (due to soft aborting fallback tasks) omit thecompleteAllcall by temporarily incrementing the total pending tasks.