fix(WRK-33): observe the discarded command-task wrapper's fault

TryStartCommandTask discarded ObserveCommandTaskAsync's task without a
fault-observing continuation -- the one gap in the NEXT-04 discipline
applied everywhere else in this file. ObserveCommandTaskAsync only
swallows OperationCanceledException, so any other exception escaping
ProcessCommandAsync's own catch path would fault the discarded wrapper
and surface only as a finalizer-time unobserved-task exception. Wrap it
with the existing ObserveFaultWhenever helper, same as every other
discarded task in this file.
This commit is contained in:
Joseph Doherty
2026-08-20 09:17:21 -04:00
parent ddfd41b06d
commit 93edb1b74d
@@ -1232,7 +1232,14 @@ public sealed class WorkerPipeSession
_activeCommandTasks.Add(commandTask);
}
_ = ObserveCommandTaskAsync(commandTask);
// WRK-33: every other discarded task in this file is wrapped with ObserveFaultWhenever
// (NEXT-04 discipline) so a fault reaching the finalizer unobserved is impossible. This
// wrapper task was the one exception — ObserveCommandTaskAsync only swallows
// OperationCanceledException, so any other exception escaping ProcessCommandAsync's own
// catch path (e.g. a future edit, or a failure past TryWriteFaultAsync's narrow filter)
// would fault the discarded task with no observer. Close the gap the same way the rest of
// the file does.
ObserveFaultWhenever(ObserveCommandTaskAsync(commandTask));
}
private async Task ObserveCommandTaskAsync(Task commandTask)