mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 15:50:12 +00:00
TUN-3738: Consume UI events even when UI is disabled
Not doing so was causing cloudflared to become stuck after some time. This would happen because the Observer pattern was sending events to the UI channel (that has 16 slots) but no one was consuming those when the UI is not enabled (which is the default case). Hence, events (such as connection disconnect / reconnect) would cause that buffer to be full and cause cloudflared to become apparently stuck, in the sense that the connections would not be reconnected.
This commit is contained in:
@@ -377,6 +377,12 @@ func StartServer(
|
||||
tunnelConfig.HAConnections,
|
||||
)
|
||||
tunnelInfo.LaunchUI(ctx, log, transportLog, uiCh)
|
||||
} else {
|
||||
go func() {
|
||||
for range uiCh {
|
||||
// Consume UI events into a noop
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
return waitToShutdown(&wg, errC, shutdownC, graceShutdownC, c.Duration("grace-period"), log)
|
||||
|
Reference in New Issue
Block a user