Skip to content

Port multiple named schedulers to 4.x#3003

Merged
lahma merged 3 commits into
mainfrom
port-multiple-schedulers-to-main
Apr 4, 2026
Merged

Port multiple named schedulers to 4.x#3003
lahma merged 3 commits into
mainfrom
port-multiple-schedulers-to-main

Conversation

@lahma

@lahma lahma commented Apr 4, 2026

Copy link
Copy Markdown
Member

Summary

Port of #3000 (3.x) to main (4.x), adapted for main branch architecture and idioms.

Changes from 3.x port

  • Files live in src/Quartz/Configuration/ and src/Quartz/Hosting/ (consolidated into core assembly, not separate Extension packages)
  • ValueTask return types on listener/job interfaces
  • IHostedLifecycleService with StartingAsync/StartedAsync/StoppingAsync/StoppedAsync hooks
  • GetDbConnectionManager (lowercase b) naming convention
  • ContainerConfigurationProcessor takes ILogger, TimeProvider dependencies
  • Collection literals [], ArgumentException.ThrowIfNullOrWhiteSpace
  • No #if conditional compilation, no netstandard2.0
  • 4.x docs under docs/documentation/quartz-4.x/packages/

All review fixes from 3.x included

  • Duplicate name guard, shutdown resilience, partial startup cleanup
  • SchedulerName setter protection, InstantiateType per-scheduler isolation
  • UseJobFactory/UseTypeLoader/UsePersistentStore guards for named schedulers
  • Null matchers coalescing, idempotent hosted service registration
  • Instance name drift prevention

Test plan

  • 17 new unit tests ported and adapted for 4.x (ValueTask interfaces)
  • Full test suite passes (1586 passed, 5 skipped)
  • Builds clean on net8.0 and net9.0

🤖 Generated with Claude Code

lahma and others added 2 commits April 4, 2026 16:24
Port of 3.x PR #3000 to 4.x, adapted for main branch idioms:
- Files in src/Quartz/Configuration/ and src/Quartz/Hosting/
  (consolidated into core Quartz assembly)
- ValueTask return types on interfaces (IJob, ISchedulerListener, etc.)
- IHostedLifecycleService with Starting/Started/Stopping/Stopped hooks
- GetDbConnectionManager (lowercase b) naming convention
- ContainerConfigurationProcessor takes ILogger, TimeProvider
- Collection literals [], ArgumentException.ThrowIfNullOrWhiteSpace
- No #if conditional compilation or netstandard2.0 support
- Full nullable reference types
- 4.x docs under docs/documentation/quartz-4.x/packages/

Includes all review fixes from 3.x PR:
- Duplicate name guard, shutdown resilience, partial startup cleanup
- SchedulerName setter protection, InstantiateType isolation
- UseJobFactory/UseTypeLoader/UsePersistentStore guards for named
- Null matchers coalescing, idempotent hosted service registration
- Instance name drift prevention via re-force after configure

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- NamedSchedulerFactory.InstantiateType: throw clear InvalidOperationException
  instead of passing null to ObjectUtils.InstantiateType (guaranteed crash)
- NamedSchedulerHostedService: re-throw OperationCanceledException after
  cleanup so host knows startup was aborted
- ServiceCollectionQuartzConfigurator.RegisterSingleton: guard for named
  schedulers to prevent global DI contamination

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Main branch is the publish source for all docs including 3.x.
Add the 3.x multiple-schedulers doc page, sidebar entry, and
see-also links that were part of the 3.x PR (#3000).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@sonarqubecloud

sonarqubecloud Bot commented Apr 4, 2026

Copy link
Copy Markdown

@lahma
lahma merged commit d1a9523 into main Apr 4, 2026
17 checks passed
@lahma
lahma deleted the port-multiple-schedulers-to-main branch April 4, 2026 13:40
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.

1 participant