Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition at system boot #461

Merged
merged 2 commits into from
Sep 12, 2023
Merged

Fix race condition at system boot #461

merged 2 commits into from
Sep 12, 2023

Conversation

DavidePrincipi
Copy link
Member

Modules and services relying on Redis for configuration discovery race against redis.service at boot time.

If local Redis instance hasn't started, or is synchronizing with master a discovery script might fail or write a bad configuration for its service. A manual service restart usually works around the issue.

This PR configures Systemd units so that user sessions (and Promtail) are started after Redis startup is complete. Only the root user is excluded from this rule, so root login works as soon as possible at boot time.

See https://trello.com/c/PaUsBoUn/427-core-p0-bad-config-after-reboot

Start rootless modules after Redis is fully functional, to avoid
connection failures and corrupted data.
If Redis is not fully started, LOKI endpoint cannot be discovered.
Also Redis waits for wg0, if the VPN is not UP Promtail cannot reach the
Loki on another node to send log records.
@DavidePrincipi DavidePrincipi added the bug Something isn't working label Sep 12, 2023
@DavidePrincipi DavidePrincipi self-assigned this Sep 12, 2023
@DavidePrincipi DavidePrincipi merged commit da3da88 into main Sep 12, 2023
5 checks passed
@DavidePrincipi DavidePrincipi deleted the fix-redis-race branch September 12, 2023 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants