mirror of
https://github.com/juanfont/headscale.git
synced 2026-05-23 18:48:42 +09:00
DisconnectContainerFromNetwork and ReconnectContainerToNetwork returned as soon as the docker API call completed, but libnetwork bridge reprogramming continued for several seconds after. The HA disconnect tests then raced and bounced between healthy and broken bridges. Poll until the container's endpoint is gone (on disconnect) or reconciled (on reconnect), and on the "conflicts with existing route" surface clear the stale subnet route from the netns and retry. Settle is now baked into the primitive so every caller benefits.
13 lines
340 B
Go
13 lines
340 B
Go
package dockertestutil
|
|
|
|
import "time"
|
|
|
|
// Docker control-plane retry policy. MaxElapsedTime sits above the
|
|
// worst observed libnetwork bridge reprogramming time (~60 s on
|
|
// contended GHA runners).
|
|
const (
|
|
DockerOpInitialInterval = 1 * time.Second
|
|
DockerOpMaxInterval = 10 * time.Second
|
|
DockerOpMaxElapsedTime = 90 * time.Second
|
|
)
|