Exit hosted runner cleanly during deprovisioning. (#3755)

This commit is contained in:
Tingluo Huang
2025-03-18 10:33:40 -04:00
committed by GitHub
parent 6b08f23b6c
commit a0ba8fd399
7 changed files with 41 additions and 1 deletions

View File

@@ -249,6 +249,11 @@ namespace GitHub.Runner.Listener
Trace.Info("Runner OAuth token has been revoked. Unable to pull message.");
throw;
}
catch (HostedRunnerDeprovisionedException)
{
Trace.Info("Hosted runner has been deprovisioned.");
throw;
}
catch (AccessDeniedException e) when (e.ErrorCode == 1)
{
throw;

View File

@@ -304,6 +304,11 @@ namespace GitHub.Runner.Listener
_accessTokenRevoked = true;
throw;
}
catch (HostedRunnerDeprovisionedException)
{
Trace.Info("Hosted runner has been deprovisioned.");
throw;
}
catch (AccessDeniedException e) when (e.ErrorCode == 1)
{
throw;

View File

@@ -697,6 +697,10 @@ namespace GitHub.Runner.Listener
{
Trace.Info("Runner OAuth token has been revoked. Shutting down.");
}
catch (HostedRunnerDeprovisionedException)
{
Trace.Info("Hosted runner has been deprovisioned. Shutting down.");
}
return Constants.Runner.ReturnCode.Success;
}