Skip to content

Adding restart reason #11191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from
Open

Adding restart reason #11191

wants to merge 18 commits into from

Conversation

RohitRanjanMS
Copy link
Member

@RohitRanjanMS RohitRanjanMS commented Jul 17, 2025

Including the restart reason in the logs will provide valuable context during troubleshooting and root cause analysis.

image

Pull request checklist

IMPORTANT: Currently, changes must be backported to the in-proc branch to be included in Core Tools and non-Flex deployments.

  • Backporting to the in-proc branch is not required
    • Otherwise: Link to backporting PR
  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • My changes do not require diagnostic events changes
    • Otherwise: I have added/updated all related diagnostic events and their documentation (Documentation issue linked to PR)
  • I have added all required tests (Unit tests, E2E tests)

Additional information

Additional PR information

Copy link
Member

@brettsam brettsam left a comment

Choose a reason for hiding this comment

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

just one minor comment

@RohitRanjanMS RohitRanjanMS marked this pull request as ready for review August 4, 2025 17:59
@Copilot Copilot AI review requested due to automatic review settings August 4, 2025 17:59
@RohitRanjanMS RohitRanjanMS requested a review from a team as a code owner August 4, 2025 17:59
Copy link
Contributor

@Copilot 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

This pull request adds restart reason logging to provide better troubleshooting context when host restarts occur. The change modifies the RestartHostAsync method across the codebase to accept a reason parameter that gets logged and included in restart events.

  • Adds a required reason parameter to IScriptHostManager.RestartHostAsync method
  • Updates all calls to RestartHostAsync throughout the codebase to include descriptive restart reasons
  • Modifies HostRestartEvent to include the restart reason and updates related logging

Reviewed Changes

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

Show a summary per file
File Description
src/WebJobs.Script/Host/IScriptHostManager.cs Adds reason parameter to RestartHostAsync interface method
src/WebJobs.Script/Eventing/Host/HostRestartEvent.cs Adds Reason property to HostRestartEvent class
src/WebJobs.Script.WebHost/WebJobsScriptHostService.cs Implements reason parameter and logs restart reason
src/WebJobs.Script.WebHost/Diagnostics/Extensions/ScriptHostServiceLoggerExtension.cs Updates logging extension to include restart reason
src/WebJobs.Script.WebHost/FileMonitoringService.cs Updates file monitoring restart calls with descriptive reasons
src/WebJobs.Script.WebHost/Controllers/HostController.cs Adds restart reasons for API-triggered restarts
Multiple test files Updates test mocks and verifications to include reason parameter
release_notes.md Documents the new feature

@RohitRanjanMS RohitRanjanMS marked this pull request as draft August 6, 2025 06:16
@RohitRanjanMS RohitRanjanMS marked this pull request as ready for review August 6, 2025 15:57
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.

4 participants