Skip to content

A generated job or trigger identity in a persistent store logs a warning (3.x) - #4114

Merged
lahma merged 1 commit into
3.xfrom
4095-3x/generated-identity-warning
Oct 18, 2026
Merged

lahma merged 1 commit into
3.xfrom
4095-3x/generated-identity-warning

Conversation

@lahma

@lahma lahma commented Oct 18, 2026

Copy link
Copy Markdown
Member

Part of #4095. Companion of #4113 on main, the warning only.

AddJob, AddTrigger and ScheduleJob with no WithIdentity store a key generated afresh on every start. A persistent store finds nothing to replace and keeps another copy each time, and every copy of a trigger fires. 3.x behaves as 4.x did, and now says so at startup:

ScheduleJob<MyApp.ReportJob> gave its trigger no identity, so it was stored under the generated key 'DEFAULT.6f1c…'. A persistent store keeps it, so each start adds another copy, and every copy of a trigger fires. Give it a stable key with WithIdentity(...)
  • Where it is recorded. Each registration records the generated key in QuartzOptions while its builder still knows none was given. That covers the configurator's AddJob/AddTrigger/ScheduleJob and QuartzOptions.AddJob/AddTrigger. A job named with a GUID on purpose does not warn. TriggerBuilder gains an internal Key, as JobBuilder already has.
  • When it fires. ContainerConfigurationProcessor.ScheduleJobs logs one warning per such registration after scheduling, when GetMetaData().JobStoreSupportsPersistence is true. Both the default and the named scheduler factories go through it.
  • How it logs. Through LibLog, like the rest of 3.x; there is no event-id catalogue on this branch. The text matches main's event 4030. The logger is taken when the warning is written, because the container sets the log provider after the processor is built.
  • Out of scope: jobs and triggers scheduled in code against IScheduler directly. The message texts main changed are left as they are here.
  • No public API change.

Verification

  • dotnet build Quartz.slnx: 0 warnings, 0 errors.
  • dotnet test src/Quartz.Tests.Unit: net10.0 2111 passed / 4 skipped; net472 2099 passed / 5 skipped.
  • GeneratedIdentityWarningTest (8 cases) passes on both frameworks. The persistent store is a RAMJobStore that reports SupportsPersistence, as ClusteredDefaultInstanceIdWarningTest does for Clustered; this unit project has no SQLite reference.

🤖 Generated with Claude Code

…ing (3.x)

AddJob, AddTrigger and ScheduleJob with no WithIdentity - on the
configurator or on QuartzOptions - store a key generated afresh on every
start. A persistent store finds nothing to replace and keeps another
copy each time, and every copy of a trigger fires.

Each registration records the generated key in QuartzOptions while its
builder still knows none was given, rather than matching a GUID-shaped
name, which a job may carry on purpose; TriggerBuilder gains an internal
Key for that, as JobBuilder already had. After scheduling, when the
scheduler's metadata says the store supports persistence,
ContainerConfigurationProcessor logs one warning per such registration,
naming the call and its job type (or the job key, for AddTrigger), the
generated key, and WithIdentity. The default and named scheduler
factories both go through it. The text matches main's event 4030; 3.x
has no event-id catalogue.

Part of #4095

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lahma
lahma merged commit e337a58 into 3.x Oct 18, 2026
14 checks passed
@lahma
lahma deleted the 4095-3x/generated-identity-warning branch October 18, 2026 03:07
This was referenced Oct 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.

1 participant