Ignore error when fail to report worker crash. (#3588)

This commit is contained in:
Tingluo Huang
2024-11-21 16:10:12 -05:00
committed by GitHub
parent e640a9fef3
commit c46dac6736

View File

@@ -545,6 +545,8 @@ namespace GitHub.Runner.Listener
detailInfo = string.Join(Environment.NewLine, workerOutput);
Trace.Info($"Return code {returnCode} indicate worker encounter an unhandled exception or app crash, attach worker stdout/stderr to JobRequest result.");
try
{
var jobServer = await InitializeJobServerAsync(systemConnection);
var unhandledExceptionIssue = new Issue() { Type = IssueType.Error, Message = detailInfo };
unhandledExceptionIssue.Data[Constants.Runner.InternalTelemetryIssueDataKey] = Constants.Runner.WorkerCrash;
@@ -569,6 +571,12 @@ namespace GitHub.Runner.Listener
throw new NotSupportedException($"JobServer type '{jobServer.GetType().Name}' is not supported.");
}
}
catch (Exception ex)
{
Trace.Error($"Catch exception during log worker process unhandled exception.");
Trace.Error(ex);
}
}
TaskResult result = TaskResultUtil.TranslateFromReturnCode(returnCode);
Trace.Info($"finish job request for job {message.JobId} with result: {result}");