Asp.Net Core 2.2.0
Sql Server 2016
Hangfire advertised feature is that scheduled tasks survive across process boundaries.
In practice I’ve noticed that whenever a Hangfire-enabled app process ends ( for any reason ) Hangfire by some mechanism immediately restarts it.
This can easily be demonstrated by
Task Monitor > MyApp.exe > End Task : immediately a new
MyApp.exe will be spun-up.
I supposed this is a reasonable strategy for background task monitor and executor meant to be integrated into an app , rather than run as a distinct service.
But I’m wondering about the implications for deploys.
- How does a Hangfire respond to aplication executable being overcopied with a new version ?
- For a Windows Service, how does Hangfire respond to stop/start service ?
- For an IIS hosted Asp.Net Core app, how does Hangfire respond stop/start site/app-pool ?
I’m also wondering about situations where one would legitimately want the process to completely end (including Hangfire stop processing all scheduled tasks) - possibly in response to a production incident or during a dev-test or QA scenario.