mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Leaking yamux session after HTTP handler is closed (#329)
* fix: Leaking yamux session after HTTP handler is closed Closes #317. The httptest server cancels the context after the connection is closed, but if a connection takes a long time to close, the request would never end. This applies a context to the entire listener that cancels on test cleanup. After discussion with @bryphe-coder, reducing the parallel limit on Windows is likely to reduce failures as well. * Switch to windows-2022 to improve decompression * Invalidate cache on matrix OS
This commit is contained in:
@@ -110,10 +110,13 @@ func (p *provisionerDaemon) connect(ctx context.Context) {
|
||||
if errors.Is(err, context.Canceled) {
|
||||
return
|
||||
}
|
||||
p.closeMutex.Lock()
|
||||
if p.isClosed() {
|
||||
p.closeMutex.Unlock()
|
||||
return
|
||||
}
|
||||
p.opts.Logger.Warn(context.Background(), "failed to dial", slog.Error(err))
|
||||
p.closeMutex.Unlock()
|
||||
continue
|
||||
}
|
||||
p.opts.Logger.Debug(context.Background(), "connected")
|
||||
|
||||
Reference in New Issue
Block a user