Merge branch 'worktree-phase1-reaktivitaet'

This commit is contained in:
mika kuns
2026-08-07 11:01:54 +02:00
13 changed files with 575 additions and 61 deletions
+19
View File
@@ -346,9 +346,28 @@ public sealed class QueueService : BackgroundService
await _runner.RunAsync(task, "queue", ct, alreadyClaimed: true);
}
catch (OperationCanceledException)
{
// Cancellation is driven by the cancel path, which already wrote the terminal status.
// Marking the task Failed here would be a regression (it would stomp Cancelled).
_logger.LogInformation("Slot runner cancelled for task {TaskId}", taskId);
}
catch (Exception ex)
{
_logger.LogError(ex, "Slot runner error for task {TaskId}", taskId);
// The picker already committed status='running' before this ran. Without this the
// task stays Running forever and the UI never hears about it — it keeps showing the
// pre-claim status because the raw-SQL claim itself never broadcasts.
try
{
await _state.FailAsync(taskId, DateTime.UtcNow,
$"Slot runner error: {ex.Message}", CancellationToken.None);
}
catch (Exception failEx)
{
_logger.LogError(failEx, "Could not mark task {TaskId} as failed after a slot error", taskId);
}
}
}
}