diff --git a/internal/manager/api_impl/api_impl.go b/internal/manager/api_impl/api_impl.go index 52ef35e2..82daa98f 100644 --- a/internal/manager/api_impl/api_impl.go +++ b/internal/manager/api_impl/api_impl.go @@ -83,6 +83,11 @@ func (f *Flamenco) WaitForShutdown(ctx context.Context) bool { // requestShutdown closes the 'done' channel, signalling to callers of // WaitForShutdown() that a shutdown is requested. func (f *Flamenco) requestShutdown() { + defer func() { + // Recover the panic that happens when the channel is closed multiple times. + // Requesting a shutdown should be possible multiple times without panicing. + recover() + }() close(f.done) }