agent/engine/docker_task_engine.go
func (engine *DockerTaskEngine) MustInit(ctx context.Context) {
	if engine.initialized {
		return
	}
	engine.mustInitLock.Lock()
	defer engine.mustInitLock.Unlock()

	errorOnce := sync.Once{}
	taskEngineConnectBackoff := retry.NewExponentialBackoff(minEngineConnectRetryDelay, maxEngineConnectRetryDelay,
		engineConnectRetryJitterMultiplier, engineConnectRetryDelayMultiplier)
	retry.RetryWithBackoff(taskEngineConnectBackoff, func() error {
		if engine.initialized {
			return nil
		}
		err := engine.Init(ctx)
		if err != nil {
			errorOnce.Do(func() {
				seelog.Errorf("Task engine: could not connect to docker daemon: %v", err)
			})
		}
		return err
	})
}
func (engine *DockerTaskEngine) MustInit(ctx context.Context) {
	if engine.initialized {
		return
	}
	engine.mustInitLock.Lock()
	defer engine.mustInitLock.Unlock()

	errorOnce := sync.Once{}
	taskEngineConnectBackoff := retry.NewExponentialBackoff(minEngineConnectRetryDelay, maxEngineConnectRetryDelay,
		engineConnectRetryJitterMultiplier, engineConnectRetryDelayMultiplier)
	retry.RetryWithBackoff(taskEngineConnectBackoff, func() error {
		if engine.initialized {
			return nil
		}
		err := engine.Init(ctx)
		if err != nil {
			errorOnce.Do(func() {
				seelog.Errorf("Task engine: could not connect to docker daemon: %v", err)
			})
		}
		return err
	})
}
func ( engine * DockerTaskEngine ) MustInit ( ctx context . Context ) { if engine . initialized { return } engine . mustInitLock . Lock ( ) defer engine . mustInitLock . Unlock ( ) errorOnce := sync . Once { } taskEngineConnectBackoff := retry . NewExponentialBackoff ( minEngineConnectRetryDelay , maxEngineConnectRetryDelay , engineConnectRetryJitterMultiplier , engineConnectRetryDelayMultiplier ) retry . RetryWithBackoff ( taskEngineConnectBackoff , func ( ) error { if engine . initialized { return nil } err := engine . Init ( ctx ) if err != nil { errorOnce . Do ( func ( ) { seelog . Errorf ( " " , err ) } ) } return err } ) }
// MustInit blocks and retries until an engine can be initialized.
MustInit blocks and retries until an engine can be initialized .