Skip to content

Commit ba82eea

Browse files
authored
Remove disableSchedulerTimeoutInWorkLoop flag (#19902)
We found and mitigated the root cause of the regression that led us to temporarily revert this change. So now I'm un-reverting it.
1 parent 71bc8ac commit ba82eea

12 files changed

+2
-39
lines changed

packages/react-reconciler/src/ReactFiberWorkLoop.new.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import {
3030
enableSchedulingProfiler,
3131
enableScopeAPI,
3232
skipUnmountedBoundaries,
33-
disableSchedulerTimeoutInWorkLoop,
3433
enableDoubleInvokingEffects,
3534
} from 'shared/ReactFeatureFlags';
3635
import ReactSharedInternals from 'shared/ReactSharedInternals';
@@ -745,7 +744,7 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) {
745744

746745
// This is the entry point for every concurrent task, i.e. anything that
747746
// goes through Scheduler.
748-
function performConcurrentWorkOnRoot(root, didTimeout) {
747+
function performConcurrentWorkOnRoot(root) {
749748
// Since we know we're in a React event, we can clear the current
750749
// event time. The next update will compute a new event time.
751750
currentEventTime = NoTimestamp;
@@ -785,18 +784,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
785784
return null;
786785
}
787786

788-
// TODO: We only check `didTimeout` defensively, to account for a Scheduler
789-
// bug we're still investigating. Once the bug in Scheduler is fixed,
790-
// we can remove this, since we track expiration ourselves.
791-
if (!disableSchedulerTimeoutInWorkLoop && didTimeout) {
792-
// Something expired. Flush synchronously until there's no expired
793-
// work left.
794-
markRootExpired(root, lanes);
795-
// This will schedule a synchronous callback.
796-
ensureRootIsScheduled(root, now());
797-
return null;
798-
}
799-
800787
let exitStatus = renderRootConcurrent(root, lanes);
801788

802789
if (

packages/react-reconciler/src/ReactFiberWorkLoop.old.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import {
3030
enableSchedulingProfiler,
3131
enableScopeAPI,
3232
skipUnmountedBoundaries,
33-
disableSchedulerTimeoutInWorkLoop,
3433
} from 'shared/ReactFeatureFlags';
3534
import ReactSharedInternals from 'shared/ReactSharedInternals';
3635
import invariant from 'shared/invariant';
@@ -739,7 +738,7 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) {
739738

740739
// This is the entry point for every concurrent task, i.e. anything that
741740
// goes through Scheduler.
742-
function performConcurrentWorkOnRoot(root, didTimeout) {
741+
function performConcurrentWorkOnRoot(root) {
743742
// Since we know we're in a React event, we can clear the current
744743
// event time. The next update will compute a new event time.
745744
currentEventTime = NoTimestamp;
@@ -779,18 +778,6 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
779778
return null;
780779
}
781780

782-
// TODO: We only check `didTimeout` defensively, to account for a Scheduler
783-
// bug we're still investigating. Once the bug in Scheduler is fixed,
784-
// we can remove this, since we track expiration ourselves.
785-
if (!disableSchedulerTimeoutInWorkLoop && didTimeout) {
786-
// Something expired. Flush synchronously until there's no expired
787-
// work left.
788-
markRootExpired(root, lanes);
789-
// This will schedule a synchronous callback.
790-
ensureRootIsScheduled(root, now());
791-
return null;
792-
}
793-
794781
let exitStatus = renderRootConcurrent(root, lanes);
795782

796783
if (

packages/shared/ReactFeatureFlags.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,4 @@ export const enableDiscreteEventFlushingChange = false;
135135

136136
export const enableEagerRootListeners = true;
137137

138-
export const disableSchedulerTimeoutInWorkLoop = false;
139-
140138
export const enableDoubleInvokingEffects = false;

packages/shared/forks/ReactFeatureFlags.native-fb.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export const deferRenderPhaseUpdateToNextBatch = true;
5050
export const decoupleUpdatePriorityFromScheduler = false;
5151
export const enableDiscreteEventFlushingChange = false;
5252
export const enableEagerRootListeners = true;
53-
export const disableSchedulerTimeoutInWorkLoop = false;
5453

5554
export const enableDoubleInvokingEffects = false;
5655

packages/shared/forks/ReactFeatureFlags.native-oss.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const deferRenderPhaseUpdateToNextBatch = true;
4949
export const decoupleUpdatePriorityFromScheduler = false;
5050
export const enableDiscreteEventFlushingChange = false;
5151
export const enableEagerRootListeners = true;
52-
export const disableSchedulerTimeoutInWorkLoop = false;
5352

5453
export const enableDoubleInvokingEffects = false;
5554

packages/shared/forks/ReactFeatureFlags.test-renderer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const deferRenderPhaseUpdateToNextBatch = true;
4949
export const decoupleUpdatePriorityFromScheduler = false;
5050
export const enableDiscreteEventFlushingChange = false;
5151
export const enableEagerRootListeners = true;
52-
export const disableSchedulerTimeoutInWorkLoop = false;
5352

5453
export const enableDoubleInvokingEffects = false;
5554

packages/shared/forks/ReactFeatureFlags.test-renderer.native.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const deferRenderPhaseUpdateToNextBatch = true;
4949
export const decoupleUpdatePriorityFromScheduler = false;
5050
export const enableDiscreteEventFlushingChange = false;
5151
export const enableEagerRootListeners = true;
52-
export const disableSchedulerTimeoutInWorkLoop = false;
5352

5453
export const enableDoubleInvokingEffects = false;
5554

packages/shared/forks/ReactFeatureFlags.test-renderer.www.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const deferRenderPhaseUpdateToNextBatch = true;
4949
export const decoupleUpdatePriorityFromScheduler = false;
5050
export const enableDiscreteEventFlushingChange = false;
5151
export const enableEagerRootListeners = true;
52-
export const disableSchedulerTimeoutInWorkLoop = false;
5352

5453
export const enableDoubleInvokingEffects = false;
5554

packages/shared/forks/ReactFeatureFlags.testing.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const deferRenderPhaseUpdateToNextBatch = true;
4949
export const decoupleUpdatePriorityFromScheduler = false;
5050
export const enableDiscreteEventFlushingChange = false;
5151
export const enableEagerRootListeners = true;
52-
export const disableSchedulerTimeoutInWorkLoop = false;
5352

5453
export const enableDoubleInvokingEffects = false;
5554

packages/shared/forks/ReactFeatureFlags.testing.www.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const deferRenderPhaseUpdateToNextBatch = true;
4949
export const decoupleUpdatePriorityFromScheduler = false;
5050
export const enableDiscreteEventFlushingChange = true;
5151
export const enableEagerRootListeners = true;
52-
export const disableSchedulerTimeoutInWorkLoop = false;
5352

5453
export const enableDoubleInvokingEffects = false;
5554

packages/shared/forks/ReactFeatureFlags.www-dynamic.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,5 @@ export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
4747
// to __VARIANT__.
4848
export const enableTrustedTypesIntegration = false;
4949
export const disableSchedulerTimeoutBasedOnReactExpirationTime = false;
50-
export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;
5150

5251
export const enableDoubleInvokingEffects = false;

packages/shared/forks/ReactFeatureFlags.www.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export const {
2828
enableDebugTracing,
2929
skipUnmountedBoundaries,
3030
enableEagerRootListeners,
31-
disableSchedulerTimeoutInWorkLoop,
3231
enableDoubleInvokingEffects,
3332
} = dynamicFeatureFlags;
3433

0 commit comments

Comments
 (0)