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

Use nc for healthcheck #653

Merged

Conversation

penguincoder
Copy link
Contributor

This is an alternative healthcheck for memcached. The prior one worked when executed with bash -c 'healthcheck' but failed silently when I removed the bash wrapper. This changes the healthcheck to use echo | nc, and I have tested this locally by taking the generated process-compose.yaml and modifying the command in the YAML. I have also tested using both 127.0.0.1 and ::1 for the listen parameter. I was not as rigorous as I should have been after I modified the last memcached PR from feedback.

@domenkozar domenkozar merged commit da0552f into cachix:main Jun 8, 2023
91 of 95 checks passed
@penguincoder penguincoder deleted the memcached-different-healthcheck branch June 8, 2023 15:55
@volker-schukai
Copy link
Contributor

If memcache is fed with stat,

echo stats | ${pkgs.netcat}/bin/nc ${cfg.bind} ${toString cfg.port} > /dev/null 2>&1

the connection will remain open and if process-compose is used,
memcache will be terminated due to missing healthcheck.

memchache should be terminated with a quit:

echo -e "stats\nquit" | ${pkgs.netcat}/bin/nc 127.0.0.1 11211 > /dev/null 2>&1

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

Successfully merging this pull request may close these issues.

None yet

3 participants