Bug 951431 - Report permanent hangs as transient hangs for now. r=froydnj, a=lsblakk
☠☠ backed out by 6332a66fff72 ☠ ☠
authorJim Chen <nchen@mozilla.com>
Tue, 14 Jan 2014 10:33:31 -0600
changeset 175809 73f3ce609c233a063b355d949a3fa02658df7c9b
parent 175808 990a21978a2dfc03bca8af57fe1843c0fe674518
child 175810 36dfb491674debf9dcc443fb8f01e0cb4992acea
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj, lsblakk
bugs951431
milestone28.0a2
Bug 951431 - Report permanent hangs as transient hangs for now. r=froydnj, a=lsblakk
xpcom/threads/BackgroundHangMonitor.cpp
--- a/xpcom/threads/BackgroundHangMonitor.cpp
+++ b/xpcom/threads/BackgroundHangMonitor.cpp
@@ -142,17 +142,17 @@ public:
   BackgroundHangThread(const char* aName,
                        uint32_t aTimeoutMs,
                        uint32_t aMaxTimeoutMs);
   ~BackgroundHangThread();
 
   // Report a hang; aManager->mLock IS locked
   void ReportHang(PRIntervalTime aHangTime);
   // Report a permanent hang; aManager->mLock IS locked
-  void ReportPermaHang() const;
+  void ReportPermaHang();
   // Called by BackgroundHangMonitor::NotifyActivity
   void NotifyActivity();
   // Called by BackgroundHangMonitor::NotifyWait
   void NotifyWait()
   {
     NotifyActivity();
     mWaiting = true;
   }
@@ -260,16 +260,17 @@ BackgroundHangManager::RunMonitorThread(
         continue;
       }
       PRIntervalTime interval = currentThread->mInterval;
       PRIntervalTime hangTime = intervalNow - interval;
       if (MOZ_UNLIKELY(hangTime >= currentThread->mMaxTimeout)) {
         // A permahang started
         // Skip subsequent iterations and tolerate a race on mWaiting here
         currentThread->mWaiting = true;
+        currentThread->mHanging = false;
         currentThread->ReportPermaHang();
         continue;
       }
 
       if (MOZ_LIKELY(!currentThread->mHanging)) {
         if (MOZ_UNLIKELY(hangTime >= currentThread->mTimeout)) {
           // A hang started
           currentThread->mStackHelper.GetStack(currentThread->mHangStack);
@@ -371,22 +372,23 @@ BackgroundHangThread::ReportHang(PRInter
     }
   }
   // Add new histogram
   newHistogram.Add(aHangTime);
   mStats.mHangs.append(Move(newHistogram));
 }
 
 void
-BackgroundHangThread::ReportPermaHang() const
+BackgroundHangThread::ReportPermaHang()
 {
   // Permanently hanged; called on the monitor thread
   // mManager->mLock IS locked
 
-  // TODO: Add telemetry reporting for perma-hangs
+  // TODO: Add more detailed analysis for perma-hangs
+  ReportHang(mMaxTimeout);
 }
 
 MOZ_ALWAYS_INLINE void
 BackgroundHangThread::NotifyActivity()
 {
   PRIntervalTime intervalNow = mManager->mIntervalNow;
   if (mWaiting) {
     mInterval = intervalNow;