Skip to content

Don't restart a resident adapter after the host has stopped - #176

Merged
hamzahalq merged 1 commit into
mainfrom
fix/restart-after-host-stopped
Oct 18, 2026
Merged

hamzahalq merged 1 commit into
mainfrom
fix/restart-after-host-stopped

Conversation

@hamzahalq

Copy link
Copy Markdown
Contributor

An adapter that exits while the host is stopping could reach ScheduleRestart after the host disposed its stop token. The ObjectDisposedException was thrown on the process's Exited callback, which nothing catches, so it crashed the whole process. This is the flaky "Test host process crashed" that failed the 10.2.4 publish and several PR builds.

ScheduleRestart now drops the restart when the host has already stopped.

Test: ResidentHostShutdownTests stops a host, then schedules a restart (threw before the fix).

@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: simplify9/coderabbit/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: f7148874-fc7e-4afe-92b7-9538bfae5a27
📥 Commits

Reviewing files that changed from the base of the PR and between 78ec477 and ec1f886.

📒 Files selected for processing: 2
  • SW.Serverless.UnitTests/ResidentHostShutdownTests.cs
  • SW.Serverless/Resident/ResidentAdapterHost.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hamzahalq
hamzahalq merged commit f1623e2 into main Oct 18, 2026
6 checks passed
@hamzahalq
hamzahalq deleted the fix/restart-after-host-stopped branch October 18, 2026 12:48
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.

2 participants