From 7d2346dfca23ac4edc7b0008c6c936e0bb086afb Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Sat, 28 Nov 2026 19:41:39 +0100 Subject: [PATCH] Correzione: un tempo zero per il fotogramma annulla subito MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Con Budget = 0 FrameService annullava con CancelAfter, cioè con un timer: su una macchina carica il timer scattava dopo la decodifica di un video piccolo e la prova del 503 riceveva 200 (esecuzione 518 di main, lavoro immagine). Ora un tempo zero annulla subito, come già VideoFrameDecoder. Co-Authored-By: Claude Opus 5.5 --- docs/stato.md | 5 +++++ src/Febe.Web/Export/FrameService.cs | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/stato.md b/docs/stato.md index 3f8c008..bfeff7b 100644 --- a/docs/stato.md +++ b/docs/stato.md @@ -50,6 +50,11 @@ adottata, da confermare con Alberto. (anche le prove H.265 da 1 s), e due prove d'interfaccia nuove sono scadute in quella pausa; la stessa revisione nell'immagine della CI in locale è verde in 10 m 33 s e nel codice di E3 non c'è nulla che blocchi i thread. Se si ripete, il prossimo passo è limitare i Chromium paralleli nelle prove (`UiBrowser`) e aggiungere `--blame-hang`. + La 510 è stata verde alla seconda prova: al primo giro la prova da capo a fondo con il sito di prova + (`TheRealServerCollectsFromTheTestSite…`) ha passato i 90 s, come già una volta prima di E3 (2 min 10 s nella 107). + Dopo l'unione la 518 di main è caduta nell'immagine su `APreviewPastItsBudgetSaysToUseTheFolderOfTheCopies`: con + un tempo zero il fotogramma si annullava con un timer, che su una macchina carica scattava dopo la decodifica; + ora un tempo zero annulla subito, come già in `VideoFrameDecoder` (ramo `correzione/fotogramma-senza-tempo`). - **Non verificato**: - le sette prove d'interfaccia nuove (`ExportInterfaceTests.Formats.cs`) girano solo nella CI di Linux; nessuna clicca «Scarica» o avvia un lavoro di fotogrammi o di video nella dimostrazione; diff --git a/src/Febe.Web/Export/FrameService.cs b/src/Febe.Web/Export/FrameService.cs index c7d0e3f..7ba00bd 100644 --- a/src/Febe.Web/Export/FrameService.cs +++ b/src/Febe.Web/Export/FrameService.cs @@ -144,7 +144,16 @@ public sealed class FrameService(IClock clock) ArgumentNullException.ThrowIfNull(path); var image = MediaConverter.ImageFormatOf(format) ?? throw new BadRequestException("I fotogrammi si salvano in JPG, PNG o WEBP senza perdita."); using var budget = CancellationTokenSource.CreateLinkedTokenSource(ct); - budget.CancelAfter(Budget); + if (Budget <= TimeSpan.Zero) + { + // No time at all: cancelled now, not by a timer that a busy machine may fire after a quick decode. + budget.Cancel(); + } + else + { + budget.CancelAfter(Budget); + } + try { await _one.WaitAsync(budget.Token).ConfigureAwait(false); -- 2.54.1