Skip to content

Commit

Permalink
Codeship crash when too many state updates happen in loop
Browse files Browse the repository at this point in the history
Summary: This setting was already enabled for FB4A and IG4A. I have tested this on M4A and there was no special movement on FADs, so we can code ship it.

Reviewed By: adityasharat

Differential Revision: D52030573

fbshipit-source-id: 2aaa9793bea29ba63636472460ee8e59fcb28394
  • Loading branch information
Fabio Carballo authored and facebook-github-bot committed Dec 11, 2023
1 parent 36b24f1 commit 6416e22
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
10 changes: 1 addition & 9 deletions litho-core/src/main/java/com/facebook/litho/ComponentTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -1549,15 +1549,7 @@ private void logStateUpdatesFromCreateLayout(@Nullable String attribution) {
+ "State updates were dispatched over 50 times during the current layout. "
+ "This happens most commonly when state updates are dispatched unconditionally from "
+ "the render method.";
if (ComponentsConfiguration.isDebugModeEnabled
|| ComponentsConfiguration.crashIfExceedingStateUpdateThreshold) {
throw new RuntimeException(message);
} else {
ComponentsReporter.emitMessage(
ComponentsReporter.LogLevel.FATAL,
STATE_UPDATES_IN_LOOP_EXCEED_THRESHOLD + attribution,
message);
}
throw new RuntimeException(message);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ internal constructor(
/** This toggles whether {@Link #LayoutThreadPoolExecutor} should timeout core threads or not */
@JvmField var shouldAllowCoreThreadTimeout: Boolean = false
@JvmField var layoutThreadKeepAliveTimeMs: Long = 1_000
@JvmField var crashIfExceedingStateUpdateThreshold: Boolean = false
@JvmField var defaultRecyclerBinderConfigUseStableId: Boolean = true
@JvmField var defaultRecyclerBinderUseStableId: Boolean = true
@JvmField var recyclerBinderStrategy: Int = 0
Expand Down

0 comments on commit 6416e22

Please sign in to comment.