Update dependency Quartz.AspNetCore to v4 - #1869
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.15.1→4.0.0Release Notes
quartznet/quartznet (Quartz.AspNetCore)
v4.0.0Quartz.NET 4.0 targets
net10.0, is asynchronous and container-built throughout, and trims a publicsurface that had accumulated for a decade. It is a major version with extensive breaking changes and
a mandatory schema migration. This page is the short form; the detail lives in the docs:
start at Start here; every breaking change with before and after, an ordered runbook for a running
deployment, and an appendix that indexes every removed name
what to run, per version and per database
the production checklist
are starting something new, none of the above applies
Highlights
net10.0only — nonetstandard2.0build, no Full Framework, no.configsupport.Quartzpackage;
StdSchedulerFactory,quartz.configdiscovery and the process-globalSchedulerRepository.Instance/DBConnectionManager.Instanceare gone. Flatquartz.*keys stillwork, translated to typed options by the one component that understands them, and a misspelled key is
refused with a message rather than ignored. Options are validated at startup, so a bad value fails
Host.Build()with every failure listed.IJob.Executetakes aCancellationToken,IJobFactoryhands out aJobScoperather than a bareinstance, every public
TaskbecameValueTask, and every asynchronous member ends with a cancellationtoken.
QueryJobs/QueryTriggersreturn aPagedResult<T>whoserows already carry what a listing needs, so a dashboard over a large schema no longer pays for the whole
schema. The old call shapes remain as extension methods.
TriggerState.Executingsays whether a trigger's job is runninganywhere in the cluster; fire instances, cluster nodes, execution groups, misfires and history are
listings that say which node they came from; the health check notices a node whose own check-in has
stopped.
ISchedulerclient over it (thereplacement for .NET Remoting, which is gone), a dashboard, typed job input (
IJob<TInput>;UsingInput(input)on a registration,ScheduleJob<TJob, TInput>(input, at)for a one-off), a retry policy a trigger carries — persisted, cluster-safe,never burning a repeat count — job execution middleware, a
[JobTimeout]attribute, executiongroups with per-node or cluster-wide limits, node affinity, and a firing that links back to the trace
that scheduled it.
started, so saving your data and scheduling the job that acts on it commit together or not at all.
(
0 15 10 1 * *is the 1st, not every day); a time the clocks skip fires when the gap ends; the parserrefuses what it used to quietly reinterpret (
1-5W,L-3in day-of-week,MON,FRI#3,MON/2, stepsof zero); the five-field Unix form and the
@daily-style macros work everywhere an expression is read.repeated fall-back hour;
CalendarIntervalTriggerwithPreserveHourOfDayAcrossDaylightSavingssteps inlocal wall-clock time and no longer drifts in zones whose delta is not a whole hour; calendars mean the
local day even where midnight itself moves. Review any schedule that crosses a transition.
Quartz.Aspire:builder.AddQuartzPersistentStore("quartz")turns an Aspire connection name into aconfigured persistent store with its telemetry and health check, with no
Aspire.*dependency; a storecan provision its own schema as it starts (
ProvisionSchema()), safe under a cluster racing to start.MapQuartzHttpApi()andMapQuartzDashboard()refuse to start unless theendpoints carry authorization or an explicit
AllowAnonymous(); a scheduler can be authorized on its ownname, and every call the dashboard makes is authorized where it is made.
ActivitySource("Quartz")andMeter("Quartz")(the names are public constants), nine instruments, spans on every store the same way,and every log line carrying a stable event id — 278 of them, catalogued on a generated page.
QuartzdeclaresIsAotCompatible; a canary ispublished natively and run against a real store on three operating systems on every pull request; the
remaining string-named paths are recorded and each has a documented alternative (#3341).
faster and 21 % less allocation on
RAMJobStore(numbers below).context object; any member added to a public interface in 4.x arrives as a default interface member.
The seams are registered in Extending Quartz.
JobRunShellare internal, andnon-public types are sealed. If something you relied on is gone, say so in an issue; these can be
reopened.
Breaking changes, the ten to know before the guide
net10.0only.Quartz.Extensions.DependencyInjection,Quartz.Extensions.HostingandQuartz.Serialization.SystemTextJsonare part ofQuartz;Quartz.Serialization.JsonisQuartz.Serialization.Newtonsoft;Quartz.OpenTracinghas no 4.x release, andOpenTelemetry.Instrumentation.Quartzproduces nothing on 4.x — subscribe to the source and meterdirectly. The first error a mixed project produces is CS0433 (a type in both
Quartz4 and a 3.xsatellite): remove the three references.
StdSchedulerFactory,DirectSchedulerFactoryandquartz.configare gone;AddQuartz(…)orQuartzSchedulerBuilder.Create(q => …)build a scheduler.Task→ValueTaskon nearly every member, and aCancellationTokenon every asynchronous one.Quartz.SpiisQuartz.Extensibility,Quartz.Simplmerged intoQuartz.Impl, the Newtonsoft typesleft the core namespaces. A string naming an old namespace still resolves, with a warning.
*Supportbase classes aregone (every member has a default body); a listener with a 3.x signature is refused at registration.
TimeOnlyandDateOnlyreplaceTimeOfDay;TimeProviderreplacesSystemTime; the semaphores are lock handlers.refused form fails at load, loudly. The reverse is quiet: an expression from another six-field
dialect that 3.x refused (no
?in either day field) now parses, and two shapes fire on a differentday than Cronos would — a bare digit in day-of-week (Quartz numbers Sunday
1) and both day fieldsrestricted (Quartz fires on the union). The guide's second audit finds them.
is dropped, one table is added. The upgrade script runs while 3.x nodes are up; the index script runs
once the last one is gone.
fire times above.
Everything else — every renamed member, every sealed type, every removed constant — is in the guide, with
the name you would have typed.
Fixes worth knowing about
The full list is spread over the six pre-release notes below. These change what a running cluster does
without saying so, and most of them are as old as 3.x:
ResumeAllcould unpause real trigger groups: it deleted the all-groups sentinel with aLIKE, andthe sentinel's four underscores are wildcards.
disagreed with itself; one rule now, and the acquisition predicate is its exact complement (#3462).
TimeProviderthe scheduler was given (#3456).DailyCalendarcould crawl for minutes toanswer months late (#3457, #3466).
[DisallowConcurrentExecution]siblings behind it (#3502); a firing whose listener notification failed was listed as executing forever;
a trigger with nothing left to fire was left behind when its last firing was abandoned (#3507).
value the JSON format could not read back went into the database anyway (#3495) — both serializers now
refuse at write time.
ACQUIREDfor good(#3673, on every 3.x version too).
RAMJobStorenotified its listeners inside its own lock, so a listener that touched the storedeadlocked (#3472).
calendar name silently killed a trigger (#3294);
MySQLDelegateforced an index the misfire sweep couldnot use.
updating a trigger on the persistent store resolved the job class and failed without it; the two
attribute flags now come from the row, so an administration node needs no
ITypeLoaderof its own(#3705). Stopping the host twice at once — which
host.StopAsync()duringRunAsync()does — nolonger throws out of
RunAsync(#3701).Numbers
Measured on one shared machine with other work running, the same harness on both branches
(
src/Quartz.Benchmark; the 3.20 half is in the tree underbaseline-3x/):MaxConcurrencyRAMJobStoreRAMJobStoreThe persistent-store fire path is batched and counts 1.27 commits per firing at the database. Two
clustered nodes ran a mixed workload for thirty minutes on PostgreSQL and on SQL Server — every trigger
family, a serial job behind an overlap detector, a retry policy, a job timeout, induced misfires, a node
killed mid-run and recovered — with peak serial concurrency 1, exactly one recovery, nothing left behind
and a flat heap, on the beta.1 build and again on the 4.0.0 commit itself. The upgrade from a running
3.20 cluster was rehearsed by hand through its mixed-version window on both engines, and the offline
upgrade over rows a released 3.20 wrote runs on every dialect on every pull request.
Known limitations
Each is documented on the page that owns it; this is the list, not the explanation.
described in the pre-release notes below.
(HTTP API,
SECURITY.md).
SendMailJobreads SMTP credentials out of job data when nothing is registered(Quartz.Jobs).
(hosted services).
MaxConcurrencydefaults to 10 on the shared thread pool(configuration reference).
HttpScheduler.StatusandSchedulerInstanceIdblock on an HTTP round trip(HTTP client).
OpenTelemetry.Instrumentation.Quartzproduces nothing on 4.x, and 4.x warns at start if it ispresent (OpenTelemetry).
TransactionScope(job stores).
Quartz.Extensions.Redis(one unit and one container fixture);Quartz.Aspireunderan AppHost was run by hand, not in CI.
publishing are what stand behind a package.
Upgrading a running deployment
The runbook is short and every step links the page that owns it. In one breath: retarget to
net10.0and drop the merged packages; on 3.x, turn binary blobs off and run the cron audit; run
schema_30_to_40_upgrade_<database>.sqlwhile 3.x nodes are still up; configure and start the 4.0 nodesone at a time (route
AddCalendarthrough the 3.x nodes until the last one is gone); runschema_30_to_40_indexes_<database>.sqlonce it is; pause any job group you relied on being paused(3.x never persisted one). A 4.0 node against a schema you have not migrated refuses to start and names
the column and the script.
If you ran a 4.0 pre-release
Everything that changed between one pre-release and the next is one appendix in the guide, build by
build: If you ran a 4.0 pre-release. 4.0.0 is the rc.2 commit: between the two tags, nothing changed
but this page and the site.
Thanks
HttpSchedulerclient(#1803, #1815, #1831, #1845), which 4.0's HTTP API carries forward.
(#3281) and the job-type acquisition filter (#3282, closing #2238).
IJobDetailfinally works."running".
years.
UseJobStore<T>seam.scheduling files.
for #3248, two 3.x bugs fixed on both branches.
Full changes
(the API becomes complete) · alpha.2
(used) · alpha.3 (operated) ·
alpha.4 (integrated) ·
alpha.5 (finished) ·
beta.1 (a promise) ·
rc.1 (rehearsed) ·
rc.2 (upgraded)
v3.20.1Quartz.NET 3.20.1 is a maintenance release: every change is a bug fix, the public API is untouched (the baselines did not move), and the schema is 3.20's. Most of it was found while 4.0 was being finished and rehearsed — a fix that turned out to be as old as 3.x was ported here rather than left on the newer line — and one item comes from a production application's 3.19.1 → 4.0 upgrade that also read on 3.x. Eight of the fixes change what a running scheduler does, each marked Behavior change worth noting below.
What changed
Landed on the branch since 3.20.0:
DailyTimeIntervalTriggerstored through the default Newtonsoft path reads back again —TimeOfDayhas no parameterless constructor, so with the trigger converters off (the default)EndTimeOfDaythrew "Unable to find a constructor" andStartTimeOfDaysilently read back as midnight. A converter scoped toTimeOfDay-typed members reads both forms; nothing about what is written changed, so every blob a released 3.20 wrote is one this reads. (9ee33fec17, fixes #3508)StartTimeUtckept its milliseconds while the fire times are counted in whole seconds, so a start of22:50:00.68could produce a first fire at22:50:00.000. Start and end are rounded down to the second when set, asCronTriggerImplalways did. (cc051a7788, #3386)RAMJobStoreand as a permanentCOMPLETErow in the ADO store. Both stores finish it now. (0af9431d3e, #3507)[DisallowConcurrentExecution]job is neither acquired nor swept, so the completion that unblocks it is the first thing that can settle its missed fire time;RAMJobStorenow does whatJobStoreSupport.RecoverUnblockedMisfiresalways did. (c9d8658a35, #3463)RAMJobStorewrotePausedoverError, so a failed trigger vanished from every listing once its group was paused andResetTriggerFromErrorStatehad nothing to reset. It now pauses only what the ADO store pauses: waiting, acquired and blocked triggers. (a56a16ca0c)RescheduleJobadvanced a never-fired repeating simple trigger's start time past a next fire time it kept, so it fired at the stale time and again at its start. (3e086091fc, #3554)overwrite-existing-dataon, and a repeating trigger that starts now fired twice milliseconds apart. (f25080cef6, #3554)Dictionary<string, string>job-data value written by the Newtonsoft package carried a$typethe System.Text.Json reader handed back as an entry, and one written by System.Text.Json came back from Json.NET as aJObject. Both readers read both shapes; neither writer changed. (83ba80ce79, part of #3582)QRTZ_SIMPROP_TRIGGERStoo — a database missing only that table passed validation and failed on the first calendar-interval, daily-time-interval or recurrence trigger insert. (b33c70487b, #3564)4b3c43a90e); untagged builds from the branch say 3.20 (0e2f6bcf31); the XML scheduling integration test opens its own fixture's data source (4c07210199, #3573).Ported from 4.0:
JobToBeExecutedescaped as itself rather than the exception the run shell catches, soTriggeredJobCompletewas never reached: the trigger stayed acquired and, for a[DisallowConcurrentExecution]job, every sibling trigger stayed blocked; the firing was also listed as executing for the life of the process. (port of #3502)IDX_QRTZ_T_NFT_ST_MISFIRE, whose second column is compared with<>and stops the seek dead. Measured on 4.x against 100,000 triggers: the count 111 ms → 0.7 ms, the sweep 66 ms → 0.7 ms. No schema change. (port of #3608)RescheduleJobandUpdateTriggerDetailson the ADO store resolved the job's class to decide whether the new trigger could run, and failed in an administration node without the assembly. Both read the job's two attribute flags fromQRTZ_JOB_DETAILSnow, so the decision is right without the class and a placeholderITypeLoadHelper— which decided that question by whether the placeholder carried the attribute — is no longer needed. (port of #3705)40001,40P01;40002excepted) is transient. Firebird reports a write conflict that way withIsTransientfalse, andMySql.Dataits 1213 deadlock. (port of #3454)SimpleTriggerinterval finer than a millisecond was stored as0, read back as zero, and left the trigger inACQUIREDfor good behind a divide-by-zero the store logged and swallowed. It is refused on write now, naming the trigger and the column;RAMJobStorekeeps accepting it. (port of #3673)List<string>or a nested object serialized happily and threw on the next read with the blob already in the database, and every later acquisition of the trigger failed on it. A value that would be stored as a JSON array, or as an object other than aDictionary<string, string>, is refused before the first byte is written, naming the entry and its type. Anything stored as a number or a string — every numeric type,DateTime,Guid,byte[],Uri— still round-trips exactly as before. (port of #3495)JsonSerializationExceptionat store time, where it used to be a blob the next read failed on. The refusal also covers three shapes that did not throw before but never came back as themselves either — a non-genericHashtable, an object whose properties are all strings, and aJobDataMapnested inside aJobDataMap— each of which the reader handed back as aDictionary<string, string>. Store one of those as a string of your own making.EndTimeUtcfalling between two fire times of the same day let the trigger go on firing until the daily window closed, andFinalFireTimeUtcreported that close even when it was a day past the end. (port of the daily half of #3458)NativeJobno longer deadlocks a child that writes more than a pipe buffer — both streams were redirected whether or notconsumeStreamsasked for them to be read, so with the defaults a chatty process blocked on its own write and the job's synchronous wait held a worker for ever. Nothing is redirected unless consumed. (port of the rc.1 fix)EnlistConnectioninside aTransactionScopetook aMicrosoft.Data.Sqliteconnection on trust, and SQLite cannot enlist, so every statement committed on the spot and a rolled-back scope left the schedule behind.EnlistTransaction(DbTransaction)still works there. (port of the beta.1 fix)now - MisfireThresholdwas a misfire toRAMJobStoreand to the ADO store's single-trigger path but not to its periodic sweep; the sweep says<=now and the acquisition predicate moved to>in step. (port of #3462)"3,14"read as314from the floating-point accessors whileGetIntthrew. (port of the beta.1 fix)GetDoubleandGetFloatthrow aFormatExceptionfor such a string where they used to answer a number a hundred times too large.[matches literally on SQL Server — T-SQL reads[as a character class inLIKE; it is escaped on that dialect only, because the standard forbids escaping a non-wildcard elsewhere. (port of the rc.1 fix)[matches the groups it names rather than the character class T-SQL read it as, so it can list, pause, resume or delete a different set than on 3.20.DirectoryScanJobstores its previous scan as something a job store can write — it kept aList<FileInfo>under[PersistJobDataAfterExecution], which System.Text.Json cannot write, so its first firing on such a store failed to persist. A legacy list already in a running scheduler is still read. (port of the rc.1 fix)DirectoryScanJobruns at all on 3.20 — it read its optional job-data keys withGetString, which throws for a key that is not there, so a job configured without a directory provider or listener name failed on every firing withKeyNotFoundException. Found while porting the previous item; the optional keys are asked for rather than read.SelectSchedulerStateRecordsbinds its parameters in statement order — only a provider withBindByNameoff could ever have noticed. (port of the alpha.3 fix)Public API
Unchanged. No signature was added, altered or removed, and the
PublicApiTestbaselines did not move.Upgrading
A drop-in upgrade from 3.20.0: no schema change, no configuration change, no migration script. Read the Behavior change worth noting bullets above — each is a case that used to be silently wrong and is now either correct or loud.
About the 4.0 line
Quartz.NET 4.0 was released on 2026-09-03. It targets
net10.0only; 3.x remains the line fornetstandard2.0and .NET Framework, and fixes that apply to both keep landing on both, which is what most of this release is. The migration guide is the map if you are considering the move.Full changes: quartznet/quartznet@v3.20.0...v3.20.1
v3.20.0Quartz.NET 3.20.0 is a feature release: the ADO.NET job store can take part in the application's own database transaction, job instantiation failures finally carry the trigger they died on, and the daylight-saving and calendar arithmetic got a systematic pass that fixed several defects a schedule can actually hit. The public API is additive only — three new members and one new exception type, nothing changed or removed — but this is not quite a drop-in upgrade. Four things to read before you take it:
database/that used to sit flat is nowdatabase/migrations/<version>/<name>_<dialect>.sql, one runnable file per database instead of one file with five commented-out dialect blocks. Old links still resolve against release tags; the mapping is below.database/migrations/3.20/). Nothing needs it to run, but PostgreSQL users should read that bullet.Highlights
quartz.jobStore.acceptEnlistedTransactionsorAcceptEnlistedTransactions(), then hand the store a connection for the duration of a scope withIScheduler.EnlistTransaction(DbTransaction)orIScheduler.EnlistConnection(DbConnection). The application owns the commit; the job store neither commits nor rolls back, and the enlistment flows with the current asynchronous context the wayTransaction.Currentdoes — which is what makes it work whileIJobStoreis a singleton and aDbContextis scoped. Nothing about it is EF Core specific. Taking part always means handing over a connection: an ambientTransactionScopealone is not enough, because a connection the job store opens for itself would be a second connection in that transaction and would force promotion to a distributed one — which needs MSDTC (Windows only, and on modern .NET also an explicit opt-in throughTransactionManager.ImplicitDistributedTransactions) and is impossible on Npgsql, which has no distributed transaction support at all. Sharing the one connection is what keeps the transaction local. Opt-in, because joining the application's transaction changes when, and whether, scheduling commits;JobStoreCMTis untouched, since running inside a container-managed transaction is that store's whole contract. (#3204, fixes #2038)txIsolationLevelSerializableapplies only to the job store's own connections.IJobFactorycannot produce a job the trigger has already fired and been committed, but there is noIJobExecutionContextyet, so no trigger or job listener can be raised andISchedulerListener.SchedulerErroris the only notification. It carried the job key as interpolated message text and nothing else, leaving callers parsing a string to find out which firing died. The newQuartz.Core.JobInstantiationException : SchedulerExceptioncarriesTrigger,JobDetailandFireInstanceId— the same shapeJobExecutionProcessExceptionhas for execution-time failures — and both catch blocks inJobRunShell.Runraise it, so the DI and non-DI paths are enriched alike. Message text is byte-identical in both paths, including a long-standing misplaced quote, so anything parsing it today keeps working while it migrates. (#3215, closes #3213)SchedulerExceptionpath the exception handed to listeners is now aJobInstantiationExceptionwrapping the factory's exception rather than being it; the original is reachable asInnerException. The choice betweenNoInstructionandSetAllJobTriggersErrorstill tests the original exception, so cancellation and disposal races behave exactly as before.TimeZoneInfo.GetUtcOffsetreturning the pre-gap offset for positive-delta zones. It is now two internalTimeZoneUtilhelpers —ResolveLocal(ambiguous → the first/daylight occurrence; nonexistent → paired with the pre-gap offset, found by scanning backwards a minute at a time so 30-minute deltas and negative-delta zone models work) andWalkToGapEnd— with all five call-site families migrated onto them. Two defects fell out: a negative-daylight-delta gap hazard, where a zone modelled with a negative delta (Europe/Dublin on TZif data, so Linux and macOS) produced an instant before the gap — a scheduler hot-loop hazard the ambiguity demotion does not cover; and a sub-second demotion defect, whereCronExpression.GetTimeAftercompared its whole-second candidate against the untruncated after-time, so a sub-second after-time inside the repeated fall-back hour demoted a valid fire a whole hour forward. The migrations are behaviour-neutral for every positive-delta zone, guarded by a minute-by-minute differential test across ±3 hours of all eight test zones' transitions. (#3198, building on #3195)GetTimeAftermonotonic in its argument again, and stopsGetTimeBeforereturning instants the expression never fires at. Fire times inside the repeated fall-back hour can therefore differ from 3.19.DailyTimeIntervalTriggerno longer fires past itsEndTimeUtc— the day-of-week advance resolved the advanced day's start-of-day through the instant-based offset overload while every sibling call site used the wall-clock policy overload, so the offset carried through theAddDayswalk was stale once the walk crossed a transition, and an in-gap start-of-day resolved one transition delta too early. TheEndTimeUtccheck inside the same method consumed the mis-resolved instant before the downstream rescue corrected it, so with an end time between the wrong instant and the right one the trigger fired once past its configured end. Only triggers with a partialDaysOfWeekset were affected — the existing tests all use a full week, where the two resolutions coincide. (#3196)HolidayCalendar,AnnualCalendar,MonthlyCalendarandWeeklyCalendarbuilt the boundary they walk as midnight at the offset the queried instant happened to carry, and advanced it withAddDays, which keeps that offset. Both assume a local day begins at midnight at the same offset the rest of the day carries, and a transition day is exactly the day where it does not. In America/Santiago, where the clocks move at midnight, the 23-hour day (2019-09-08) answered with the excluded instant it was asked about, and the 25-hour day (2019-04-06) overshot by 23 hours; in a zone that moves its clocks later in the day the answer lands a whole date out (Europe/Helsinki on 2024-03-31, asked from the afternoon, answered 2024-03-30); and a run of excluded days crossing a transition drifts by the transition delta. The boundary now resolves local midnight by naming the date rather than by adding twenty-four hours.CronCalendarnever had the shape. (#3478, fixes #3457)DailyCalendar.GetNextIncludedTimeUtcis jumped to rather than walked up to — it named the window's edges on the date the argument fell on and paired them with the argument's offset, whileIsTimeIncludedconverts into the calendar's zone first, so a question asked in UTC about a calendar keeping another zone's hours had the two disagree. The jump then landed on a window an offset away from the one being tested, the loop fell through to its last resort — one precision step at a time, bounded only by where the wrong window happened to end — and it could step clean over an included stretch. The measured reproduction, an inverted 21:00–22:00 America/Santiago calendar asked at2019-04-07T01:30Z:2019-09-09T00:00:59.999Z, five months late, reached a minute of wall clock at a time, against2019-04-08T01:00Zin two passes now. The whole daily-calendar half of the new test fixture takes 1 m 52 s against the unfixed file and milliseconds against this one. The answer is now named from the window's own edges — the instant the day opens at, the second reading of that edge where the clock repeats it, the instant the clocks moved where a fall-back takes the clock back to before the window opened, and the day's own first instant — each checked against the calendar's own rule before it is taken. (#3478, fixes #3466)precisionStepMillisoptimisation (#2285) is removed, because a jump has nothing left to speed up and it was rounding the answer up by as much as a minute.GetNextIncludedTimeUtcanswers are now exact: a06:00–22:00calendar asked at21:59Zreturns22:00:00.001Zwhere it returned22:01:00.000Z, and asking about an instant the calendar already includes gives back the next millisecond rather than the next minute. TheNestedCalendarTestsperformance test that came with #2285 is unchanged and passes.GetTimeRangeStartingTimeUtcandGetTimeRangeEndingTimeUtcare public and carried the same offset assumption in public — asked in UTC about a Santiago calendar they answered about the UTC date at+00:00, which no caller can use. They now read the date of the local day the instant falls in. For a calendar left on the defaultTimeZoneInfo.Localasked with a local value, the conversion is a no-op. No signature changed.UseNewtonsoftJsonSerializerleavesRegisterTriggerConvertersoff by default, and with it off Json.NET's default contract wrote aTimeZoneInfoas its whole public surface (Id,DisplayName,BaseUtcOffset, all read-only), so reading it back set nothing and the trigger's getter fell through toTimeZoneInfo.Local. A trigger stored under Tokyo fired on whichever zone the reading machine was in, silently. Measured before the fix:CalendarIntervalTriggerImpl,RecurrenceTriggerImplandCronTriggerImplall came back on the reading machine's zone. An internalTimeZoneInfoConverterwrites the id and reads both the id and the old object form, attached per property to members typed as aTimeZoneInfo— deliberately not on the serializer's converter list, since that list is consulted for a value's runtime type wherever it appears and a zone held in a job data map value would then lose the$typethat path carries. The four privatetimeZoneInfoIdhelpers that were meant for this and never worked (DefaultContractResolverdoes not serialize private members) are gone.BLOB_TRIGGERSpayloads written byBinaryObjectSerializerare unaffected: they are computed properties, so there was never a backing field forBinaryFormatterto match. (#3505)DailyTimeIntervalTriggerImplcannot be read back at all —TimeOfDayhas no parameterless constructor, so Json.NET fails loudly onEndTimeOfDay. It predates this change, it fails rather than corrupting, and the ADO store reaches that path only for a trigger it serializes as a blob, so a shippedDailyTimeIntervalTriggerdoes not go through it.JobInterruptMonitorPlugininterrupted by job key, so a monitor that elapsed cancelled every running execution of that job rather than the one it was watching. Worse, a vetoed fire's monitor was never cancelled at all, because the only cleanup point wasTriggerComplete, which a vetoed fire never reaches — so every veto leaked a live monitor that would later interrupt an unrelated, healthy execution of the same job. It now callsInterrupt(fireInstanceId), cancels the monitor on veto through a job listener of its own, does not start a second monitor for a re-executed job sharing a fire instance id, and removes its own bookkeeping entry when it elapses. Both scenarios are exactly as analysed in the report. (#3249, fixes #3248)IScheduler.Interrupt(fireInstanceId)now raisesISchedulerListener.JobInterrupted, matching theInterrupt(JobKey)overload — relevant to anyone calling the fire-instance overload directly. AndAutoInterruptableis now read from the merged job data map, consistent withMaxRunTime, so a trigger's data map can opt a fire in or out of auto-interruption rather than only override the timeout.CALENDAR_NAMEwas written as''rather thanNULLstopped firing entirely: every job store gates its calendar lookup onCalendarName is not null, so the empty string passed the gate, the lookup found nothing, and the fire was silently dropped.AbstractTrigger.CalendarNamenow stores a blank name asnull, without trimming — the name is a lookup key against whateverAddCalendarstored, so trimming" holidays "would break a calendar registered with padding and create the same bug from the other direction. That one setter is the choke point forTriggerBuilder, both JSON converters and the ADO read-back, so databases already holding''self-heal: the row rehydrates as "no calendar", the trigger fires again on the next acquisition, and the column is written back asNULLnext time it is persisted. No migration script.TriggerDetailsUpdate.WithCalendarNamenormalizes separately, since both stores check the calendar exists before the value reaches the trigger setter. Both stores now also log when they skip a fire over a missing calendar, which turns this class of report from a mystery into a one-line diagnosis. The dashboard, which produced the empty string by rebuilding the trigger field by field out of its display projection, now edits the trigger JSON it was already handed — which also preserves the node pin and the real trigger type it used to drop. (#3295, fixes #3294)CronCalendar.GetNextIncludedTimeUtcnever terminated from an excluded instant (it advanced withGetNextValidTimeAfter, which lands on another excluded time);CronCalendar's three-argument constructor dropped itstimeZone, so the calendar evaluated its exclusion cron in machine-local time; transient-error classification short-circuited onDbException.IsTransient, which on any .NET 6+ host matches every driver exception — so the deadlock-1205 list, the SQLite busy/locked check and the timeout fallback were all dead code and retryable failures were classified permanent; a prefix trigger-group pause paused only the first matching group and a prefix resume could never clear what a prefix pause recorded;JobInterruptMonitorPluginsilently ignored a numericMaxRunTime, falling back to the five-minute default with no log; and Newtonsoft deserialization populated read-only collections through their getters, so on the default configuration aDaysOfWeeksubset came back as all seven days. (#3334)DaysOfWeeksubset survives the plain Newtonsoft round trip. Deliberately not backported: the 4.x store-parity semantic alignments (pause-over-Error,ResumeAllmarker clearing, sentinel visibility, exception re-wrap types), which change observable maintenance-branch behaviour.SelectInstancesFiredTriggerRecordswas the only fired-trigger reader that never readPRIORITYandClusterRecoverassigns from exactly that reader, so every recovery trigger ran at priority 0, below the default 5, deprioritising recovery work precisely when a node has died. FourIDriverDelegatemembers failed on every provider because their bound parameter names never matched their SQL; nothing in the scheduler calls them, which is why it never surfaced, but they are public surface reachable fromJobStoreSupportsubclasses. And group matcher values are now escaped, with!as the escape character becauseESCAPE '\'is a MySQL syntax error while!is a plain literal on all six supported databases. (#3202)%or_now match literally in group matcher queries. Previously those characters acted as LIKE wildcards, so a matcher could list, pause, resume or delete groups it was not meant to match. The same correction meansResumeAlldeletes only the_$_ALL_GROUPS_PAUSED_$_sentinel row rather than a pattern in which all eight underscores were single-character wildcards.sched_name, which every Quartz statement filters on first, andidx_qrtz_t_nft_sthad its columns reversed —(next_fire_time, trigger_state)against an acquire query that is two equalities then a range, so the index could never bound the scan on state or scheduler name. This is the shape behind slow-acquire-on-PostgreSQL reports. Verified on live PostgreSQL 16: the upgrade script and a fresh install converge on byte-identicalpg_indexessets, and a 160,000-trigger acquire-plan comparison moves all three predicates from post-filter into the index condition — buffer hits 136 → 57, discarded rows 61 → 0. Across the other dialects, indexes whose columns are a leftmost prefix of a wider same-table index are dropped, with the coverer named on every drop.IDX_QRTZ_J_GRPdeliberately stays on 3.x, unlike 4.x, because its 4.x coverer does not exist here and it serves the group listings. The migration is optional and performance-only —database/migrations/3.20/index_alignment_<dialect>.sql. (#3203)database/migrations/<version>/<name>_<dialect>.sql, one directly-runnable file per database instead of one file carrying five commented-out dialect blocks, with every statement guarded so re-running is a no-op (SQLiteADD COLUMNis the documented exception — SQLite has no conditional DDL). The scripts are generated from one description in the build, because six hand-written dialect variants is how they drift, andVerifyMigrationsfails a checked-in script that no longer matches.database/README.mdis the new index: run order, per-version status, and the old-path → new-path map reproduced below. The migrations previously had no test coverage at all;MigrationScriptTestnow builds a 3.16-era schema from a checked-in baseline, applies 3.17 → 3.18 → 3.19 → 3.20 in order, applies each twice so the guards are exercised, and asserts the result matches what the currenttables_<dialect>.sqlproduces, table for table, column for column, index for index — on all six databases. It caught two real defects on the way: PostgreSQL's index alignment usedCREATE INDEX IF NOT EXISTSfor three indexes that already exist in a 3.16 schema under the same name with different columns, so the guard silently kept the wrong shape — includingidx_qrtz_t_nft_st; and MySQL'sQRTZ_BLOB_TRIGGERScarried an InnoDB-auto-named inline index duplicating its primary key that the migration had left in place. It also backports the 2.5→2.6QRTZ_CRON_TRIGGERS.TIME_ZONE_IDfix (#1985), which never reached this branch. (#3219, fixes #3218)main, and this branch links to them — they were briefly mirrored here, and a mirror goes stale silently every time 4.x's schema moves. A confidently wrong upgrade script is worse than one that is plainly somewhere else, sodatabase/migrations/4.0/is not on this branch anddatabase/README.mdpoints at https://github.com/quartznet/quartznet/tree/main/database/migrations/4.0 in every place it used to link to the folder. (#3373, and [#3326](htConfiguration
📅 Schedule: (in timezone Asia/Shanghai)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.