Skip to content

Commit

Permalink
Remove feature flag to skip mount hook notifications (#43504)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #43504

Changelog: [internal]

We identified the issue in the experiments already, so we can remove this flag.

Reviewed By: sammy-SC

Differential Revision: D54945099

fbshipit-source-id: 4d547569eb3bbfd011f5d6894d87bfa542cac07b
  • Loading branch information
rubennorte authored and facebook-github-bot committed Mar 18, 2024
1 parent ebe26c1 commit a2e2240
Show file tree
Hide file tree
Showing 21 changed files with 20 additions and 175 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<a3cb24f7faddd86beb617c8314c1bfed>>
* @generated SignedSource<<bdd9f28c6de15e64ce03c505a3f4f34b>>
*/

/**
Expand Down Expand Up @@ -88,12 +88,6 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun inspectorEnableModernCDPRegistry(): Boolean = accessor.inspectorEnableModernCDPRegistry()

/**
* This is a temporary flag to disable part of the mount hooks pipeline to investigate a crash.
*/
@JvmStatic
public fun skipMountHookNotifications(): Boolean = accessor.skipMountHookNotifications()

/**
* When enabled, it uses the modern fork of RuntimeScheduler that allows scheduling tasks with priorities from any thread.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<8539cf7ba13ab52ca878efd2c4858d7a>>
* @generated SignedSource<<7ae379135157666d9646f1d8eeec9989>>
*/

/**
Expand All @@ -30,7 +30,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
private var enableSpannableBuildingUnificationCache: Boolean? = null
private var inspectorEnableCxxInspectorPackagerConnectionCache: Boolean? = null
private var inspectorEnableModernCDPRegistryCache: Boolean? = null
private var skipMountHookNotificationsCache: Boolean? = null
private var useModernRuntimeSchedulerCache: Boolean? = null

override fun commonTestFlag(): Boolean {
Expand Down Expand Up @@ -123,15 +122,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
return cached
}

override fun skipMountHookNotifications(): Boolean {
var cached = skipMountHookNotificationsCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.skipMountHookNotifications()
skipMountHookNotificationsCache = cached
}
return cached
}

override fun useModernRuntimeScheduler(): Boolean {
var cached = useModernRuntimeSchedulerCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<cd7257d4b1414f7aacd02a79b9295a46>>
* @generated SignedSource<<244a0656beee8e018585bdd4bb4e5cd1>>
*/

/**
Expand Down Expand Up @@ -48,8 +48,6 @@ public object ReactNativeFeatureFlagsCxxInterop {

@DoNotStrip @JvmStatic public external fun inspectorEnableModernCDPRegistry(): Boolean

@DoNotStrip @JvmStatic public external fun skipMountHookNotifications(): Boolean

@DoNotStrip @JvmStatic public external fun useModernRuntimeScheduler(): Boolean

@DoNotStrip @JvmStatic public external fun override(provider: Any)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<99263973c4a06fdc91e7c9edf4aa4e19>>
* @generated SignedSource<<d0985b19d61af8bdf47c322b7a59e203>>
*/

/**
Expand Down Expand Up @@ -43,7 +43,5 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun inspectorEnableModernCDPRegistry(): Boolean = false

override fun skipMountHookNotifications(): Boolean = false

override fun useModernRuntimeScheduler(): Boolean = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<e8550b0c2494b223b82e6fab0a827d53>>
* @generated SignedSource<<919eb0f27540e5dd7a1e028663c23264>>
*/

/**
Expand Down Expand Up @@ -34,7 +34,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
private var enableSpannableBuildingUnificationCache: Boolean? = null
private var inspectorEnableCxxInspectorPackagerConnectionCache: Boolean? = null
private var inspectorEnableModernCDPRegistryCache: Boolean? = null
private var skipMountHookNotificationsCache: Boolean? = null
private var useModernRuntimeSchedulerCache: Boolean? = null

override fun commonTestFlag(): Boolean {
Expand Down Expand Up @@ -137,16 +136,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
return cached
}

override fun skipMountHookNotifications(): Boolean {
var cached = skipMountHookNotificationsCache
if (cached == null) {
cached = currentProvider.skipMountHookNotifications()
accessedFeatureFlags.add("skipMountHookNotifications")
skipMountHookNotificationsCache = cached
}
return cached
}

override fun useModernRuntimeScheduler(): Boolean {
var cached = useModernRuntimeSchedulerCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<268a87860fea5f281567d2142f90b0d4>>
* @generated SignedSource<<ddbe652a9094bd6af4bdb741fc17ea7c>>
*/

/**
Expand Down Expand Up @@ -43,7 +43,5 @@ public interface ReactNativeFeatureFlagsProvider {

@DoNotStrip public fun inspectorEnableModernCDPRegistry(): Boolean

@DoNotStrip public fun skipMountHookNotifications(): Boolean

@DoNotStrip public fun useModernRuntimeScheduler(): Boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<d697a8ac9c347c63a5fd592bccbfb8b5>>
* @generated SignedSource<<393c6cf93399cfe0b0533927877531d5>>
*/

/**
Expand Down Expand Up @@ -99,12 +99,6 @@ class ReactNativeFeatureFlagsProviderHolder
return method(javaProvider_);
}

bool skipMountHookNotifications() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("skipMountHookNotifications");
return method(javaProvider_);
}

bool useModernRuntimeScheduler() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useModernRuntimeScheduler");
Expand Down Expand Up @@ -165,11 +159,6 @@ bool JReactNativeFeatureFlagsCxxInterop::inspectorEnableModernCDPRegistry(
return ReactNativeFeatureFlags::inspectorEnableModernCDPRegistry();
}

bool JReactNativeFeatureFlagsCxxInterop::skipMountHookNotifications(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::skipMountHookNotifications();
}

bool JReactNativeFeatureFlagsCxxInterop::useModernRuntimeScheduler(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::useModernRuntimeScheduler();
Expand Down Expand Up @@ -222,9 +211,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"inspectorEnableModernCDPRegistry",
JReactNativeFeatureFlagsCxxInterop::inspectorEnableModernCDPRegistry),
makeNativeMethod(
"skipMountHookNotifications",
JReactNativeFeatureFlagsCxxInterop::skipMountHookNotifications),
makeNativeMethod(
"useModernRuntimeScheduler",
JReactNativeFeatureFlagsCxxInterop::useModernRuntimeScheduler),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<c3bb3615d6a32333f4f20e9d204b5dbb>>
* @generated SignedSource<<e0466f307c37b0c46a09d3a792060fcd>>
*/

/**
Expand Down Expand Up @@ -60,9 +60,6 @@ class JReactNativeFeatureFlagsCxxInterop
static bool inspectorEnableModernCDPRegistry(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool skipMountHookNotifications(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool useModernRuntimeScheduler(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<fd7ff07ffc0f5f7b2d553a6b5064a1c0>>
* @generated SignedSource<<cc7c7aa6ac71f94f8dd8fc8cc0c18308>>
*/

/**
Expand Down Expand Up @@ -61,10 +61,6 @@ bool ReactNativeFeatureFlags::inspectorEnableModernCDPRegistry() {
return getAccessor().inspectorEnableModernCDPRegistry();
}

bool ReactNativeFeatureFlags::skipMountHookNotifications() {
return getAccessor().skipMountHookNotifications();
}

bool ReactNativeFeatureFlags::useModernRuntimeScheduler() {
return getAccessor().useModernRuntimeScheduler();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<cbf10b0a7ed3d4892d53e5ae2319f4a8>>
* @generated SignedSource<<d104b9219b7658544101bbd175f8fa7d>>
*/

/**
Expand Down Expand Up @@ -87,11 +87,6 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool inspectorEnableModernCDPRegistry();

/**
* This is a temporary flag to disable part of the mount hooks pipeline to investigate a crash.
*/
RN_EXPORT static bool skipMountHookNotifications();

/**
* When enabled, it uses the modern fork of RuntimeScheduler that allows scheduling tasks with priorities from any thread.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<6c1e6b6a51cd6fdddae40d3b61ae2b36>>
* @generated SignedSource<<f7d54fe8d458d80359a8d6e0e5816b1b>>
*/

/**
Expand Down Expand Up @@ -209,24 +209,6 @@ bool ReactNativeFeatureFlagsAccessor::inspectorEnableModernCDPRegistry() {
return flagValue.value();
}

bool ReactNativeFeatureFlagsAccessor::skipMountHookNotifications() {
auto flagValue = skipMountHookNotifications_.load();

if (!flagValue.has_value()) {
// This block is not exclusive but it is not necessary.
// If multiple threads try to initialize the feature flag, we would only
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.

markFlagAsAccessed(10, "skipMountHookNotifications");

flagValue = currentProvider_->skipMountHookNotifications();
skipMountHookNotifications_ = flagValue;
}

return flagValue.value();
}

bool ReactNativeFeatureFlagsAccessor::useModernRuntimeScheduler() {
auto flagValue = useModernRuntimeScheduler_.load();

Expand All @@ -236,7 +218,7 @@ bool ReactNativeFeatureFlagsAccessor::useModernRuntimeScheduler() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.

markFlagAsAccessed(11, "useModernRuntimeScheduler");
markFlagAsAccessed(10, "useModernRuntimeScheduler");

flagValue = currentProvider_->useModernRuntimeScheduler();
useModernRuntimeScheduler_ = flagValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<4c5446d5b72429d090e17523f2d544a7>>
* @generated SignedSource<<d13ffc557c3874e9bdd78558cd309829>>
*/

/**
Expand Down Expand Up @@ -41,7 +41,6 @@ class ReactNativeFeatureFlagsAccessor {
bool enableSpannableBuildingUnification();
bool inspectorEnableCxxInspectorPackagerConnection();
bool inspectorEnableModernCDPRegistry();
bool skipMountHookNotifications();
bool useModernRuntimeScheduler();

void override(std::unique_ptr<ReactNativeFeatureFlagsProvider> provider);
Expand All @@ -53,7 +52,7 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;

std::array<std::atomic<const char*>, 12> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 11> accessedFeatureFlags_;

std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> batchRenderingUpdatesInEventLoop_;
Expand All @@ -65,7 +64,6 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> enableSpannableBuildingUnification_;
std::atomic<std::optional<bool>> inspectorEnableCxxInspectorPackagerConnection_;
std::atomic<std::optional<bool>> inspectorEnableModernCDPRegistry_;
std::atomic<std::optional<bool>> skipMountHookNotifications_;
std::atomic<std::optional<bool>> useModernRuntimeScheduler_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<95e3fd7cf662623e3c09b093649d4ff2>>
* @generated SignedSource<<62de1b0e27590ad769296358a4f42c7a>>
*/

/**
Expand Down Expand Up @@ -67,10 +67,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return false;
}

bool skipMountHookNotifications() override {
return false;
}

bool useModernRuntimeScheduler() override {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<26990a0a11bb2d7cf8510773b6ece099>>
* @generated SignedSource<<3117fc0389416297369a47ee480eb906>>
*/

/**
Expand Down Expand Up @@ -35,7 +35,6 @@ class ReactNativeFeatureFlagsProvider {
virtual bool enableSpannableBuildingUnification() = 0;
virtual bool inspectorEnableCxxInspectorPackagerConnection() = 0;
virtual bool inspectorEnableModernCDPRegistry() = 0;
virtual bool skipMountHookNotifications() = 0;
virtual bool useModernRuntimeScheduler() = 0;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<4f7daa629ad90a9ab2fdc99e7c51e355>>
* @generated SignedSource<<27923a2dbf1dcbad238a4d06ebb54fb5>>
*/

/**
Expand Down Expand Up @@ -87,11 +87,6 @@ bool NativeReactNativeFeatureFlags::inspectorEnableModernCDPRegistry(
return ReactNativeFeatureFlags::inspectorEnableModernCDPRegistry();
}

bool NativeReactNativeFeatureFlags::skipMountHookNotifications(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::skipMountHookNotifications();
}

bool NativeReactNativeFeatureFlags::useModernRuntimeScheduler(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::useModernRuntimeScheduler();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<a56abf163708537dceb8f4b443102384>>
* @generated SignedSource<<53251a11631eccf1fcc334b14f9ca4c6>>
*/

/**
Expand Down Expand Up @@ -55,8 +55,6 @@ class NativeReactNativeFeatureFlags

bool inspectorEnableModernCDPRegistry(jsi::Runtime& runtime);

bool skipMountHookNotifications(jsi::Runtime& runtime);

bool useModernRuntimeScheduler(jsi::Runtime& runtime);
};

Expand Down
Loading

0 comments on commit a2e2240

Please sign in to comment.