Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 509f9d38b696c0f867a987dbe8c00229ab13f2fd
      
https://github.com/WebKit/WebKit/commit/509f9d38b696c0f867a987dbe8c00229ab13f2fd
  Author: Brady Eidson <[email protected]>
  Date:   2025-07-28 (Mon, 28 Jul 2025)

  Changed paths:
    M Source/WTF/wtf/RunLoop.cpp
    M Source/WTF/wtf/RunLoop.h
    M Source/WTF/wtf/cf/RunLoopCF.cpp
    M Source/WebCore/workers/WorkerRunLoop.cpp
    M Source/WebCore/workers/WorkerRunLoop.h

  Log Message:
  -----------
  Track and log reasons for ServiceWorkers spinning in a tight loop
rdar://156968388
https://bugs.webkit.org/show_bug.cgi?id=296605

Reviewed by Basuke Suzuki.

We know that in some situations, ServiceWorkers are spinning their CFRunLoop 
excessively,
firing CFRunLoopTimers in a tight loop.

While doing so, they appear to not be making "web progress", as defined by 
either handling
a message queue message or firing the shared timer.

This patch detects an arbitrary set of such spins in an attempt to learn more 
about them.

Have `RunLoop` keep track of its installed timers, and allow extracting those 
timer names
for logging purposes:
* Source/WTF/wtf/RunLoop.cpp:
(WTF::RunLoop::registerTimer):
(WTF::RunLoop::unregisterTimer):
(WTF::RunLoop::listActiveTimersForLogging const):
* Source/WTF/wtf/RunLoop.h:
* Source/WTF/wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::TimerBase::TimerBase):
(WTF::RunLoop::TimerBase::~TimerBase):

Teach WorkerRunLoop::run() to track the specific scenario of repeated spins 
based on
arbitrary metrics, and log if/when the fault condition occurs:
* Source/WebCore/workers/WorkerRunLoop.cpp:
(WebCore::WorkerDedicatedRunLoop::run):
(WebCore::WorkerDedicatedRunLoop::runInDebuggerMode):
(WebCore::WorkerDedicatedRunLoop::runInMode):
* Source/WebCore/workers/WorkerRunLoop.h:

Canonical link: https://commits.webkit.org/297968@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to