fix(chromium): stop pinning proxy when chromedp start fails

This commit is contained in:
Julien Neuhart
2026-05-22 09:44:25 +02:00
parent 2a9bf6bf11
commit 27e70fde46
+9
View File
@@ -169,6 +169,15 @@ func (b *chromiumBrowser) Start(logger *slog.Logger) error {
if err != nil {
cancel()
allocatorCancel()
// The pinning proxy started before chromedp; tear it down so a
// supervisor retry can re-bind. Stop is a no-op when the proxy
// was never started (operator-configured --chromium-proxy-server
// or --chromium-host-resolver-rules).
// See https://github.com/gotenberg/gotenberg/issues/1559.
stopErr := b.pinningProxy.Stop(logger)
if stopErr != nil {
logger.ErrorContext(context.Background(), fmt.Sprintf("stop pinning proxy after failed start: %s", stopErr))
}
return fmt.Errorf("run exec allocator: %w", err)
}