Skip to content

Commit cb20a1c

Browse files
[0.81] Clean up feature flag preventShadowTreeCommitExhaustionWithLocking (#52862)
* Clean up feature flag preventShadowTreeCommitExhaustionWithLocking (#52791) Summary: Pull Request resolved: #52791 Changelog: [internal] This cleans up this feature flag as it doesn't work as intended. We'll try another approach with a different flag instead. Reviewed By: sammy-SC Differential Revision: D78815892 fbshipit-source-id: 4c651a3a225de9cfb54d00346343c7f2e3bea1d5 * Implement solution for ShadowTree commmit exhaustion using recursive locks (behind a flag) (#52795) Summary: Pull Request resolved: #52795 Changelog: [internal] This is another attempt to fix #51870, inspired by #52314 but gated behind a feature flag until we've tested it carefully. Reviewed By: sammy-SC Differential Revision: D78817100 fbshipit-source-id: 45e6cae019b212528f2b2e74b9f52fe43d07f537 * [LOCAL] Correctly sort preventShadowTreeCommitExhaustion after merge conflict --------- Co-authored-by: Rubén Norte <rubennorte@meta.com>
1 parent 5f3d297 commit cb20a1c

24 files changed

+112
-90
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<f5f8c15a68610c9453d4085626effee2>>
7+
* @generated SignedSource<<3e4d74a17c15742d35db9e4247f3e1c1>>
88
*/
99

1010
/**
@@ -316,7 +316,7 @@ public object ReactNativeFeatureFlags {
316316
* Enables a new mechanism in ShadowTree to prevent problems caused by multiple threads trying to commit concurrently. If a thread tries to commit a few times unsuccessfully, it will acquire a lock and try again.
317317
*/
318318
@JvmStatic
319-
public fun preventShadowTreeCommitExhaustionWithLocking(): Boolean = accessor.preventShadowTreeCommitExhaustionWithLocking()
319+
public fun preventShadowTreeCommitExhaustion(): Boolean = accessor.preventShadowTreeCommitExhaustion()
320320

321321
/**
322322
* Enables storing js caller stack when creating promise in native module. This is useful in case of Promise rejection and tracing the cause.

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<773ddcede573164ba82db671341ddc3f>>
7+
* @generated SignedSource<<e7c1c6d184681d98320aac2a23c06288>>
88
*/
99

1010
/**
@@ -67,7 +67,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
6767
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
6868
private var hideOffscreenVirtualViewsOnIOSCache: Boolean? = null
6969
private var preparedTextCacheSizeCache: Double? = null
70-
private var preventShadowTreeCommitExhaustionWithLockingCache: Boolean? = null
70+
private var preventShadowTreeCommitExhaustionCache: Boolean? = null
7171
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
7272
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
7373
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
@@ -503,11 +503,11 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
503503
return cached
504504
}
505505

506-
override fun preventShadowTreeCommitExhaustionWithLocking(): Boolean {
507-
var cached = preventShadowTreeCommitExhaustionWithLockingCache
506+
override fun preventShadowTreeCommitExhaustion(): Boolean {
507+
var cached = preventShadowTreeCommitExhaustionCache
508508
if (cached == null) {
509-
cached = ReactNativeFeatureFlagsCxxInterop.preventShadowTreeCommitExhaustionWithLocking()
510-
preventShadowTreeCommitExhaustionWithLockingCache = cached
509+
cached = ReactNativeFeatureFlagsCxxInterop.preventShadowTreeCommitExhaustion()
510+
preventShadowTreeCommitExhaustionCache = cached
511511
}
512512
return cached
513513
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<96fca46813d841eb7f4d043010513999>>
7+
* @generated SignedSource<<ba62d616188ed439c85c66cfd055810d>>
88
*/
99

1010
/**
@@ -122,7 +122,7 @@ public object ReactNativeFeatureFlagsCxxInterop {
122122

123123
@DoNotStrip @JvmStatic public external fun preparedTextCacheSize(): Double
124124

125-
@DoNotStrip @JvmStatic public external fun preventShadowTreeCommitExhaustionWithLocking(): Boolean
125+
@DoNotStrip @JvmStatic public external fun preventShadowTreeCommitExhaustion(): Boolean
126126

127127
@DoNotStrip @JvmStatic public external fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
128128

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<8ebd61411e0e0ac8c8b307cf803f1206>>
7+
* @generated SignedSource<<12c2727291b635ef7c3163d153669c2c>>
88
*/
99

1010
/**
@@ -117,7 +117,7 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
117117

118118
override fun preparedTextCacheSize(): Double = 200.0
119119

120-
override fun preventShadowTreeCommitExhaustionWithLocking(): Boolean = false
120+
override fun preventShadowTreeCommitExhaustion(): Boolean = false
121121

122122
override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean = false
123123

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<a7e62fa950e2716e664e7f6d30d4c941>>
7+
* @generated SignedSource<<3ea9946ef21c8ac8bb9bb63712636e89>>
88
*/
99

1010
/**
@@ -71,7 +71,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
7171
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
7272
private var hideOffscreenVirtualViewsOnIOSCache: Boolean? = null
7373
private var preparedTextCacheSizeCache: Double? = null
74-
private var preventShadowTreeCommitExhaustionWithLockingCache: Boolean? = null
74+
private var preventShadowTreeCommitExhaustionCache: Boolean? = null
7575
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
7676
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
7777
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
@@ -554,12 +554,12 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
554554
return cached
555555
}
556556

557-
override fun preventShadowTreeCommitExhaustionWithLocking(): Boolean {
558-
var cached = preventShadowTreeCommitExhaustionWithLockingCache
557+
override fun preventShadowTreeCommitExhaustion(): Boolean {
558+
var cached = preventShadowTreeCommitExhaustionCache
559559
if (cached == null) {
560-
cached = currentProvider.preventShadowTreeCommitExhaustionWithLocking()
561-
accessedFeatureFlags.add("preventShadowTreeCommitExhaustionWithLocking")
562-
preventShadowTreeCommitExhaustionWithLockingCache = cached
560+
cached = currentProvider.preventShadowTreeCommitExhaustion()
561+
accessedFeatureFlags.add("preventShadowTreeCommitExhaustion")
562+
preventShadowTreeCommitExhaustionCache = cached
563563
}
564564
return cached
565565
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<93aab733661b558c1701b728c18b3d00>>
7+
* @generated SignedSource<<58da46268043f086730132430735b720>>
88
*/
99

1010
/**
@@ -23,5 +23,5 @@ public open class ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android :
2323
// We could use JNI to get the defaults from C++,
2424
// but that is more expensive than just duplicating the defaults here.
2525

26-
override fun preventShadowTreeCommitExhaustionWithLocking(): Boolean = true
26+
override fun preventShadowTreeCommitExhaustion(): Boolean = true
2727
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<f3b9aa1ed32aa3e013e16d4abb10b9cf>>
7+
* @generated SignedSource<<1e81de36735c6c9286b228c75c9a0228>>
88
*/
99

1010
/**
@@ -117,7 +117,7 @@ public interface ReactNativeFeatureFlagsProvider {
117117

118118
@DoNotStrip public fun preparedTextCacheSize(): Double
119119

120-
@DoNotStrip public fun preventShadowTreeCommitExhaustionWithLocking(): Boolean
120+
@DoNotStrip public fun preventShadowTreeCommitExhaustion(): Boolean
121121

122122
@DoNotStrip public fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
123123

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<7fac1c2c0c3ce131442319925e4231dc>>
7+
* @generated SignedSource<<cf7b6ff66c614ca2acc6667a80c5590d>>
88
*/
99

1010
/**
@@ -321,9 +321,9 @@ class ReactNativeFeatureFlagsJavaProvider
321321
return method(javaProvider_);
322322
}
323323

324-
bool preventShadowTreeCommitExhaustionWithLocking() override {
324+
bool preventShadowTreeCommitExhaustion() override {
325325
static const auto method =
326-
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("preventShadowTreeCommitExhaustionWithLocking");
326+
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("preventShadowTreeCommitExhaustion");
327327
return method(javaProvider_);
328328
}
329329

@@ -632,9 +632,9 @@ double JReactNativeFeatureFlagsCxxInterop::preparedTextCacheSize(
632632
return ReactNativeFeatureFlags::preparedTextCacheSize();
633633
}
634634

635-
bool JReactNativeFeatureFlagsCxxInterop::preventShadowTreeCommitExhaustionWithLocking(
635+
bool JReactNativeFeatureFlagsCxxInterop::preventShadowTreeCommitExhaustion(
636636
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
637-
return ReactNativeFeatureFlags::preventShadowTreeCommitExhaustionWithLocking();
637+
return ReactNativeFeatureFlags::preventShadowTreeCommitExhaustion();
638638
}
639639

640640
bool JReactNativeFeatureFlagsCxxInterop::traceTurboModulePromiseRejectionsOnAndroid(
@@ -865,8 +865,8 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
865865
"preparedTextCacheSize",
866866
JReactNativeFeatureFlagsCxxInterop::preparedTextCacheSize),
867867
makeNativeMethod(
868-
"preventShadowTreeCommitExhaustionWithLocking",
869-
JReactNativeFeatureFlagsCxxInterop::preventShadowTreeCommitExhaustionWithLocking),
868+
"preventShadowTreeCommitExhaustion",
869+
JReactNativeFeatureFlagsCxxInterop::preventShadowTreeCommitExhaustion),
870870
makeNativeMethod(
871871
"traceTurboModulePromiseRejectionsOnAndroid",
872872
JReactNativeFeatureFlagsCxxInterop::traceTurboModulePromiseRejectionsOnAndroid),

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<07daae0284829d56b7eaa330b1973e02>>
7+
* @generated SignedSource<<dae981c66bf0751fd2863937ecf255d8>>
88
*/
99

1010
/**
@@ -171,7 +171,7 @@ class JReactNativeFeatureFlagsCxxInterop
171171
static double preparedTextCacheSize(
172172
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
173173

174-
static bool preventShadowTreeCommitExhaustionWithLocking(
174+
static bool preventShadowTreeCommitExhaustion(
175175
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
176176

177177
static bool traceTurboModulePromiseRejectionsOnAndroid(

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<0179ba45718903d6fec6dcc19b0e1aaa>>
7+
* @generated SignedSource<<f73bbcd926a835c09b70d814c6662dbb>>
88
*/
99

1010
/**
@@ -214,8 +214,8 @@ double ReactNativeFeatureFlags::preparedTextCacheSize() {
214214
return getAccessor().preparedTextCacheSize();
215215
}
216216

217-
bool ReactNativeFeatureFlags::preventShadowTreeCommitExhaustionWithLocking() {
218-
return getAccessor().preventShadowTreeCommitExhaustionWithLocking();
217+
bool ReactNativeFeatureFlags::preventShadowTreeCommitExhaustion() {
218+
return getAccessor().preventShadowTreeCommitExhaustion();
219219
}
220220

221221
bool ReactNativeFeatureFlags::traceTurboModulePromiseRejectionsOnAndroid() {

0 commit comments

Comments
 (0)