Add logger for potential nested infinite loop before throwing#33744
Closed
jackpope wants to merge 1 commit intofacebook:mainfrom
Closed
Add logger for potential nested infinite loop before throwing#33744jackpope wants to merge 1 commit intofacebook:mainfrom
jackpope wants to merge 1 commit intofacebook:mainfrom
Conversation
c768fa0 to
cfa1d1e
Compare
cfa1d1e to
73975da
Compare
73975da to
49ea00d
Compare
…rowing Gather production data in a `enableInfiniteLoopDetection` experiment around existing potential infinite loops. We disabled `enableInfiniteLoopDetection` with facebook#31088 as it was introducing new crashes that were hard to debug, especially with sibling prewarming. One issue with the previous rollout is that we were introducing new crashes for components that may have settled after the 50 pass limit, but before a real crash or infinite loop. This happened more frequently after enabling sibling prewarming which in some cases increased render counts that may have already been close to the limit. This change enables an injectable logging function where we used to throw (at 50 nested renders) while continuing to throw an error if that is hit 10 times (500 total nested renders being the new limit for throwing). This is a temporary mechanism to allow us to collect more data about potential crashes in production, without introducing new crashes ourselves. The goal will be to design a smarter mechanism, maybe not counting prewarming passes for example, and/or adjusting the final limit to make it easier to enable this on existing apps.
49ea00d to
d5e57ce
Compare
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.
Gather production data in a
enableInfiniteLoopDetectionexperiment around existing potential infinite loops.We disabled
enableInfiniteLoopDetectionwith #31088 as it was introducing new crashes that were hard to debug, especially with sibling prewarming.One issue with the previous rollout is that we were introducing new crashes for components that may have settled after the 50 pass limit, but before a real crash or infinite loop. This happened more frequently after enabling sibling prewarming which in some cases increased render counts that may have already been close to the limit.
This change enables a console error where we expect to throw (at 50 nested renders) while continuing to throw an error if that is hit 10 times (500 total nested renders being the new limit for throwing).
This is a temporary approach to allow us to collect more data about potential crashes in production, without introducing too many new crashes ourselves. We can measure the delta of warnings and crashes. The goal will be to make the mechanism smarter, maybe not counting prewarming passes for example, and/or adjusting the final limit to make it easier to enable this on existing apps.