From: Tom Clegg Date: Wed, 2 Dec 2020 20:47:48 +0000 (-0500) Subject: Fix deadlock on error. X-Git-Url: https://git.arvados.org/lightning.git/commitdiff_plain/827cbfd60abe637ace2e24bee80a0b4c11507602 Fix deadlock on error. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- diff --git a/import.go b/import.go index f4e0cd0008..f9d3a1a0ba 100644 --- a/import.go +++ b/import.go @@ -452,6 +452,13 @@ func (cmd *importer) tileInputs(tilelib *tileLibrary, infiles []string) error { }() } tileJobs.Wait() + if len(errs) > 0 { + // Must not wait on encodeJobs in this case. If the + // tileJobs goroutines exited early, some funcs in + // todo haven't been called, so the corresponding + // encodeJobs will wait forever. + return <-errs + } encodeJobs.Wait() go close(errs)