// Token: 0x0600088A RID: 2186 RVA: 0x00028CE0 File Offset: 0x00026EE0
 public static void TriggerBugcheckIfRequired(DateTime bugcheckRequestTimeUtc, string bugcheckReason)
 {
     if (RegistryParameters.DisableBugcheckOnHungIo != 0)
     {
         ReplayCrimsonEvents.BugcheckAttemptSkipped.Log <string>(bugcheckReason);
         return;
     }
     if (Interlocked.CompareExchange(ref BugcheckHelper.s_numThreadsInBugcheck, 1, 0) == 1)
     {
         ReplayCrimsonEvents.BugcheckAttemptSkippedInProgress.Log <string>(bugcheckReason);
         return;
     }
     try
     {
         DateTime utcNow        = DateTime.UtcNow;
         DateTime localBootTime = AmHelper.GetLocalBootTime();
         if (bugcheckRequestTimeUtc > localBootTime || localBootTime >= utcNow)
         {
             ReplayCrimsonEvents.BugCheckAttemptTriggered.Log <string, string>(localBootTime.ToString("s"), bugcheckReason);
             bool flag = false;
             ExTraceGlobals.FaultInjectionTracer.TraceTest <bool>(4291177789U, ref flag);
             Exception ex = null;
             if (!flag)
             {
                 ex = BugcheckHelper.KillWinInitProcess();
             }
             else
             {
                 AmTrace.Error("Skipping KillProcess() of 'winint.exe' due to Fault Injection.", new object[0]);
             }
             if (ex != null)
             {
                 ReplayCrimsonEvents.BugcheckAttemptFailed.Log <string, string, string>(ex.Message, localBootTime.ToString("s"), bugcheckReason);
             }
         }
     }
     finally
     {
         if (Interlocked.CompareExchange(ref BugcheckHelper.s_numThreadsInBugcheck, 0, 1) == 0)
         {
             DiagCore.RetailAssert(false, "We should not have more than 1 thread in TriggerBugcheckIfRequired()", new object[0]);
         }
     }
 }
Ejemplo n.º 2
0
 protected override void RaiseRedEvent(IHealthValidationResultMinimal result)
 {
     ReplayCrimsonEvents.ServerLevelDatabaseStaleStatusCheckFailed.Log <string, string>(base.Identity, EventUtil.TruncateStringInput(result.ErrorMessage, 32766));
     MonitoringAlert.Tracer.TraceError((long)this.GetHashCode(), "ServerLevelDatabaseStaleStatusAlert: RaiseRedEvent() called! Recovery will be attempted via Bugcheck.");
     BugcheckHelper.TriggerBugcheckIfRequired(DateTime.UtcNow, "ServerLevelDatabaseStaleStatusAlert is attempting recovery via BugCheck due to hung GetCopyStatus() RPC.");
 }