diff --git a/backend/src/main/java/org/raddatz/familienarchiv/service/SenderModelService.java b/backend/src/main/java/org/raddatz/familienarchiv/service/SenderModelService.java index 653203d4..be9318a7 100644 --- a/backend/src/main/java/org/raddatz/familienarchiv/service/SenderModelService.java +++ b/backend/src/main/java/org/raddatz/familienarchiv/service/SenderModelService.java @@ -173,6 +173,11 @@ public class SenderModelService { * Promotes the oldest QUEUED sender run to RUNNING and triggers its training. * Called in the finally block of triggerSenderTraining, creating a sequential chain: * each run promotes the next only after it fully completes (success or failure). + * + * This is intentionally tail-recursive via the @Async thread: the same thread holds the + * full queue drain, serialising all sender training runs naturally without an external + * scheduler. With N queued runs the thread stays occupied for N sequential trainings — + * acceptable because the @Async executor is dedicated to long-running background work. */ private void promoteNextQueuedRun() { Optional queuedOpt = txTemplate.execute(status ->