Skip to content

Avoid throw in SelfUpdaters.#4274

Merged
TingluoHuang merged 1 commit intomainfrom
users/tihuang/setuptelemtry
Mar 3, 2026
Merged

Avoid throw in SelfUpdaters.#4274
TingluoHuang merged 1 commit intomainfrom
users/tihuang/setuptelemtry

Conversation

@TingluoHuang
Copy link
Copy Markdown
Member

@TingluoHuang TingluoHuang requested a review from a team as a code owner March 3, 2026 03:12
Copilot AI review requested due to automatic review settings March 3, 2026 03:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the runner self-update flows to avoid propagating exceptions during self-update failures (per actions-runtime issue #5424), and instead surface failures via logging/terminal output while allowing the listener to continue running.

Changes:

  • Stop rethrowing exceptions from SelfUpdate in both legacy and V2 self-updaters.
  • Add error logging (Trace.Error) and user-visible terminal error output when self-update fails.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Runner.Listener/SelfUpdater.cs Swallows self-update exceptions and logs/shows an error instead of throwing.
src/Runner.Listener/SelfUpdaterV2.cs Same change for the newer self-update flow (message contains package metadata directly).
Comments suppressed due to low confidence (2)

src/Runner.Listener/SelfUpdater.cs:126

  • This changes the contract of SelfUpdate from throwing on failures (e.g., download/validation errors) to swallowing exceptions. The existing L0 tests currently assert exceptions are thrown (e.g., TestSelfUpdateAsync_DownloadRunner / TestSelfUpdateAsync_ValidateHash); they will need to be updated to assert the new false return behavior (and/or verify error output).
            catch (Exception ex)
            {
                Trace.Error(ex);
                _terminal.WriteError($"Runner update failed: {ex.Message}");
                _updateTrace.Enqueue(ex.ToString());
            }

src/Runner.Listener/SelfUpdaterV2.cs:126

  • This changes the contract of SelfUpdate from throwing on failures (e.g., download/validation errors) to swallowing exceptions. The existing L0 tests for SelfUpdaterV2 currently assert exceptions are thrown; they should be updated to reflect the new false return behavior (and/or verify error output).
            catch (Exception ex)
            {
                Trace.Error(ex);
                _terminal.WriteError($"Runner update failed: {ex.Message}");
                _updateTrace.Enqueue(ex.ToString());
            }

aiqiaoy
aiqiaoy previously approved these changes Mar 3, 2026
@TingluoHuang TingluoHuang force-pushed the users/tihuang/setuptelemtry branch from efd59f9 to ea4c543 Compare March 3, 2026 03:33
@TingluoHuang TingluoHuang merged commit a9a07a6 into main Mar 3, 2026
12 checks passed
@TingluoHuang TingluoHuang deleted the users/tihuang/setuptelemtry branch March 3, 2026 03:44
dawidmalina pushed a commit to dawidmalina/github-runner that referenced this pull request Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants