DescriptionStop Service Workers that execute JavaScript for too long.
The motivation behind this change is to:
- not block the registration queue on a "while(true) {}" worker
- mitigate SW's from eating too much CPU/battery without being stopped
This adds a "ping" protocol from the browser to the worker thread. If the
worker thread is busy executing JS it will fail to ack the ping.
Each ping waits 30 seconds for a pong. If a pong is received, the next
ping is sent after 10 seconds. Otherwise, the worker is stopped.
This only stops workers that are busy executing synchronous JS. If the
worker does something like repeatedly extend a Promise chain, it will still
be able to ACK and live on. Remaining work is to set a time limit for an
inflight request.
Depends on https://codereview.chromium.org/930213002/
BUG=445150, 372436
Committed: https://crrev.com/b7f2b2f58a139038a970586c32b078b258519c5e
Cr-Commit-Position: refs/heads/master@{#317745}
Patch Set 1 #Patch Set 2 : rebase? #
Total comments: 5
Patch Set 3 : better tests #Patch Set 4 : fix timeout value #
Total comments: 8
Patch Set 5 : sync #Patch Set 6 : comments #Patch Set 7 : rethink #Messages
Total messages: 21 (5 generated)
|