From af1a4cbf7adf2acae6f869e397198752d150e29a Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Fri, 16 Apr 2021 16:45:09 -0500 Subject: [PATCH] Revert expiration for retry lanes (#21300) Retries should be allowed to expire if they are CPU bound for too long, but when I made this change it caused a spike in browser crashes. There must be some other underlying bug; not super urgent but ideally should figure out why and fix it. Unfortunately we don't have a repro for the crashes, only detected via production metrics. --- packages/react-reconciler/src/ReactFiberLane.new.js | 8 +++++++- packages/react-reconciler/src/ReactFiberLane.old.js | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberLane.new.js b/packages/react-reconciler/src/ReactFiberLane.new.js index 219c8cadb7..c9a0702ce7 100644 --- a/packages/react-reconciler/src/ReactFiberLane.new.js +++ b/packages/react-reconciler/src/ReactFiberLane.new.js @@ -362,12 +362,18 @@ function computeExpirationTime(lane: Lane, currentTime: number) { case TransitionLane14: case TransitionLane15: case TransitionLane16: + return currentTime + 5000; case RetryLane1: case RetryLane2: case RetryLane3: case RetryLane4: case RetryLane5: - return currentTime + 5000; + // TODO: Retries should be allowed to expire if they are CPU bound for + // too long, but when I made this change it caused a spike in browser + // crashes. There must be some other underlying bug; not super urgent but + // ideally should figure out why and fix it. Unfortunately we don't have + // a repro for the crashes, only detected via production metrics. + return NoTimestamp; case SelectiveHydrationLane: case IdleHydrationLane: case IdleLane: diff --git a/packages/react-reconciler/src/ReactFiberLane.old.js b/packages/react-reconciler/src/ReactFiberLane.old.js index 4672d5a92c..467369229e 100644 --- a/packages/react-reconciler/src/ReactFiberLane.old.js +++ b/packages/react-reconciler/src/ReactFiberLane.old.js @@ -362,12 +362,18 @@ function computeExpirationTime(lane: Lane, currentTime: number) { case TransitionLane14: case TransitionLane15: case TransitionLane16: + return currentTime + 5000; case RetryLane1: case RetryLane2: case RetryLane3: case RetryLane4: case RetryLane5: - return currentTime + 5000; + // TODO: Retries should be allowed to expire if they are CPU bound for + // too long, but when I made this change it caused a spike in browser + // crashes. There must be some other underlying bug; not super urgent but + // ideally should figure out why and fix it. Unfortunately we don't have + // a repro for the crashes, only detected via production metrics. + return NoTimestamp; case SelectiveHydrationLane: case IdleHydrationLane: case IdleLane: