Hi Etienne, do you mind reviewing?
Also, I'm curious if worker throttling something your team would be interested in pursuing? I don't know why this work stalled, but seems like it would be nice to finish, even if just to close the loophole of bouncing through a worker to bypass main thread throttling.
scheduler_->OnLifecycleStateChanged(SchedulingLifecycleState::kHidden);This used to crash.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
ty!
Hi Etienne, do you mind reviewing?
Also, I'm curious if worker throttling something your team would be interested in pursuing? I don't know why this work stalled, but seems like it would be nice to finish, even if just to close the loophole of bouncing through a worker to bypass main thread throttling.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[blink scheduler] Fix crashes in (experimental) worker throttling
This CL fixes two potential crashes that occur with
kDedicatedWorkerThrottling** enabled.
1. It's possible for a lifecycle-changing task (e.g. throttling state
change) to run after the worker has been disposed, in which case
the throttleable task queue's destroyed throttler gets dereferenced.
This can occur, for example, if the work task running while the
lifecycle task gets queued calls `self.close()`. This CL fixes this
by checking the disposed state in OnLifecycleStateChanged().
2. The throttling code doesn't handle all `SchedulingLifecycleState`s,
rather it unconditionally decrements the throttling ref count if
transitioning to any state other than kThrottled. This trips a
DCHECK if, for example, transitioning from kNotThrottled to
kHidden since we attempt to decrement the count below zero.
This CL fixes this by checking the previous throttling state and
only manipulating the ref count if transitioning to or from
kThrottled. Note that this feature does not throttle at all in
kHidden, which differs from main thread (nor does it handle
intensive throttling), but this is beyond this scope of this CL.
**kDedicatedWorkerThrottling: this feature has not been in active
development since 2021. Rather than remove this now (since I think we
should consider reviving it), this CL is scoped to fixing some known
crashes.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |