The ack blocks the thread that ran the task
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
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
Línea de trabajo
Start at the consumer loop where fetch, execute, and acknowledge are serialized, and compare its stop-and-join handling with the prefetcher. Validate the design on a quiet machine, covering writer shutdown, ack failure ordering, durability trade-offs, and the latency-bound benchmark target.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Each task acknowledgement sits on the critical path of the consumer. The loop fetches a task, runs it, calls acknowledge(), and starts again. Prefetching removed the fetch round trip from that path. The ack still blocks the thread that just ran the task.
Measurement (20,000 echo tasks, one process, one thread, prefetch 128, loaded machine): the ack uses 63 µs of client CPU and 97 µs blocked on the response for each task. The per-task wall time is 318 µs. The ack is thus about half of the loop. The blocked part is pure latency that the worker can use for the next task.
Proposal
Give finished results to an ack writer instead of an inline ack. The consumer puts the completed TaskResult in a queue and immediately picks up the next task. A dedicated thread serializes and acknowledges the results. Prefetch already hides the fetch round trip. This change hides the other one.
Trade-offs that need a decision
- The durability window becomes slightly wider. A crash between execution and ack already loses the ack today. A queue between the two extends that window by one task. The lease reaper covers the task, but the result of a completed task can be lost. Today the result is written immediately.
- Shutdown order. The writer must drain before the process exits. It needs the same stop-and-join handling as the prefetcher.
- It hides latency but does not remove work. The CPU cost stays. On a CPU-saturated host or with several worker threads that already overlap their acks, the gain is smaller. The win applies to latency-bound configurations with one thread.
- Ordering. Acks do not need an order today. A queue raises the question of what occurs when one ack fails and the next ack succeeds.
Why this issue exists
This is the largest remaining structural item. Prefetch already amortizes the fetch side (the acquire path decreases from a full round trip for each task to 0.008 calls for each task at prefetch 128). The ack is the only per-task round trip that remains. The other option is server-side work, which has a bound. Redis uses 20 to 54 µs for each task, depending on the load of the instance. That is about a tenth to a third of the loop, so the scripts alone cannot close the gap.
Found while validating per-task performance claims. This item needs a design decision, not a patch. The absolute microseconds come from a loaded machine. Measure again on a quiet machine before you commit to a target.
- Lenguaje dominante
- Python
- Estrellas
- 19
- Forks
- 1
- Merge medio
- 9 h 46 min
- PR fusionados (30 d)
- 17
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 codingjoe/threadmill
-
bug real side quest
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
codingjoe/threadmill#78 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug real
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
codingjoe/threadmill#73 ·
Los mantenedores suelen responder en 1 día
-
perf real
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
codingjoe/threadmill#74 ·
Los mantenedores suelen responder en 1 día
-
bug real
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
codingjoe/threadmill#75 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug real
Dificultad 4/5 3-5 días Aptitud para principiantes 64/100
codingjoe/threadmill#71 ·
Los mantenedores suelen responder en 1 día
Todos los issues de codingjoe/threadmill
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
pytest-dev/pluggy#757 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
NousResearch/hermes-agent#134960 ·
Los mantenedores suelen responder en 1 día
-
HTML backend: `<br>` leaks the internal sentinel U+E000 into list items, headings and captionsPosiblemente ocupada @morten-lagabote la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
docling-project/docling#4671 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
good first issue hacktoberfest infra
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día