Recover jobs left InProgress when a node dies, without Redis
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 18/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- csharp, mongodb, redis
- Bereich
- backend, databases, distributed-systems
Rechercherichtung
Start with how a node releases its own rows in src/TickerNet.EntityFrameworkCore/DependencyInjection/ServiceExtension.cs, then read NodeHeartBeatBackgroundService and ReleaseDeadNodeResources for the Redis path, and the row-claiming loop in src/TickerNet/Src/BackgroundServices/TickerNetSchedulerBackgroundService.cs. Done means a lease (LockedAt) is renewed while a job runs, a stale lease can be taken over without Redis, and late writes from a lost lease are rejected, across EF Core, MongoDB, Redis and in-memory providers. This needs an ADR in site/decisions/ before code.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
What happens
A job is marked InProgress with a LockHolder when a node starts it. If that node dies, the row stays InProgress until something releases it, and there are only two ways that happens:
- With Redis,
NodeHeartBeatBackgroundServicenotices the missing heartbeat and callsReleaseDeadNodeResourcesfor the dead node. - Without Redis, a node only releases its own rows when it starts again with the same
NodeIdentifier(src/TickerNet.EntityFrameworkCore/DependencyInjection/ServiceExtension.cs).NodeIdentifierdefaults to the machine name, which changes for every container or pod, so in most deployments the rows are never released.
Release also has a single outcome: the row goes back to Idle and runs again. A job that hangs on a live node is never released at all.
Separately, the scheduler marks every row it fetches as InProgress before it waits for a free worker slot (src/TickerNet/Src/BackgroundServices/TickerNetSchedulerBackgroundService.cs), so with a low MaxConcurrency many rows sit InProgress without running, and all of them are stranded if the node dies.
Expected
- Work held by a node that's gone is recovered without Redis, based on time: for example the node renews a lease (
LockedAt) while it runs the job, and any node may take over a row whose lease is older than a configurable timeout. - A per-function (or global) choice of what recovery does: run it again, or mark it failed. Jobs that aren't safe to repeat need the second.
- An optional execution timeout that cancels a job running longer than allowed.
Notes
-
Mark a row
InProgressonly when a worker slot is taken; until then it stays claimed but not started. -
Touches every provider: EF Core (
BasePersistenceProvider), MongoDB, Redis and the in-memory provider. -
Lease renewal must not run more often than needed; one update per running job every few seconds is the order of magnitude to aim for.
-
Late writes from a node that lost its lease must be rejected, so a recovered job isn't finished twice.
Part of the TickerQ comparison roadmap. Design it from this description only: never read or copy code, tests or docs from TickerQ 10.5.0 or later, which is under a commercial license (see CONTRIBUTING.md). If it adds or changes public API, add an ADR in site/decisions/ and list the API in the pull request. Comment here if you'd like to pick it up, and ask anything in Discussions.
- Vorherrschende Sprache
- C#
- Sterne
- 0
- Forks
- 2
- Ø Merge
- 1 Std. 8 Min.
- Gemergte PRs (30 T.)
- 24
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TickerNet/TickerNet
-
.NET bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag
-
.NET enhancement good first issue roadmap
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Document PathBase inside the dashboard branch and WebDAV on IISEvtl. vergeben @harryhawwy69 hat das heute übernommen. Offendocumentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 40/100
Maintainer antworten meist innerhalb von 1 Tag
-
TickerFunctionProvider's registry is publicly writableEvtl. vergeben @harryhawwy69 hat das heute übernommen. Offen.NET bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
Maintainer antworten meist innerhalb von 1 Tag
-
Cron editor accepts 7 for Sunday, then saving fails with a generic errorEvtl. vergeben @harryhawwy69 hat das heute übernommen. Offenbug good first issue javascript
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 38/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in TickerNet/TickerNet
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
dotnet-outdated/dotnet-outdated#871 ·
Maintainer antworten meist innerhalb von 1 Tag
-
triage/untriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
unoplatform/uno#26676 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
jhaizhou-ops/S2Arm#2177 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
area-CodeGen-coreclr untriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
dotnet/runtime#138181 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
CO spearhead is too loudOffenS: Untriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 2 Tagen