Recover jobs left InProgress when a node dies, without Redis
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 18/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- csharp, mongodb, redis
- Área
- backend, databases, distributed-systems
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C#
- Estrellas
- 0
- Forks
- 2
- Merge medio
- 1 h 8 min
- PR fusionados (30 d)
- 24
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TickerNet/TickerNet
-
.NET bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Add TickerResult.EnsureSuccess()Abierto.NET enhancement good first issue roadmap
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Document PathBase inside the dashboard branch and WebDAV on IISPosiblemente ocupada @harryhawwy69 la tomó hoy. Abiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 40/100
Los mantenedores suelen responder en 1 día
-
TickerFunctionProvider's registry is publicly writablePosiblemente ocupada @harryhawwy69 la tomó hoy. Abierto.NET bug
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
Cron editor accepts 7 for Sunday, then saving fails with a generic errorPosiblemente ocupada @harryhawwy69 la tomó hoy. Abiertobug good first issue javascript
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
Los mantenedores suelen responder en 1 día
Todos los issues de TickerNet/TickerNet
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
dotnet-outdated/dotnet-outdated#871 ·
Los mantenedores suelen responder en 1 día
-
triage/untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
unoplatform/uno#26676 ·
Los mantenedores suelen responder en 1 día
-
[问题] 导出文件时,提示后面还有1243390911步Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
jhaizhou-ops/S2Arm#2177 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
area-CodeGen-coreclr untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
dotnet/runtime#138181 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
CO spearhead is too loudAbiertoS: Untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 2 días