Skip to content

[BUG] Stream mode blocks middleware startupΒ #252

@david-garcia-garcia

Description

@david-garcia-garcia

Is your feature request related to a problem? Please describe. πŸ›
If the crowdsec service is down during traefik stratup, the middleware will wait for the initial sincronization to fail, potentially haulting the whole routing initialization until it has finished.

This is the code:

	if (config.CrowdsecMode == configuration.StreamMode || config.CrowdsecMode == configuration.AloneMode) && streamTicker == nil {
		if config.CrowdsecMode == configuration.AloneMode {
			if err := getToken(bouncer); err != nil {
				bouncer.log.Error("New:getToken " + err.Error())
				return nil, err
			}
		}
		handleStreamTicker(bouncer)
		isStartup = false
		streamTicker = startTicker("stream", config.UpdateIntervalSeconds, log, func() {
			handleStreamTicker(bouncer)
		})
	}

Describe the solution you'd like ✨
Revisit the startup process to avoid anything that blocks middleware startup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions