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

nixos/redis Add connection wait script to ensure connections can be made to redis #96453

Closed
wants to merge 3 commits into from

Conversation

jappeace
Copy link
Contributor

Motivation for this change

We had an issue where our application would
start to early and crashed because redis connections
weren't available yet.

Adding this should ensure connections can be made to
redis. (and we can safely requires= ["redis.service"])

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@alyssais
Copy link
Member

alyssais commented Aug 27, 2020

Redis appears to support systemd readiness notification, which would be more more efficient than polling. Can you see if adding --supervised systemd and setting Type=notify solves the problem for you?

Edit: Actually, we already do this. In that case, either something is misconfigured here, or I guess this is possibly a Redis bug?

@jappeace
Copy link
Contributor Author

So this is the error we got:

image

It's configured properly though:

image

Note that postgres does this as well:

https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/databases/postgresql.nix#L319

I'd call this a bug yes, but same for postgres. Why is it giving the ready signal while it's still loading?

@jappeace jappeace marked this pull request as draft August 27, 2020 17:10
@jappeace
Copy link
Contributor Author

I'm not sure if this works at all, we still have the issue.

@aanderse
Copy link
Member

Did anyone ever dig deeper on this and find a cause?

@jappeace
Copy link
Contributor Author

No I kindoff forgot about it.

@jappeace
Copy link
Contributor Author

github for some reason thought this was related to my melpa changes so I just closed it 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants