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

Re-evaluate max_restarts #317

Closed
srid opened this issue Sep 7, 2024 · 3 comments · Fixed by #348
Closed

Re-evaluate max_restarts #317

srid opened this issue Sep 7, 2024 · 3 comments · Fixed by #348

Comments

@srid
Copy link
Member

srid commented Sep 7, 2024

Should we make it a default in process-compose-flake? Or perhaps file an issue in process-compose itself asking what the recommend default should be, and why that default is not in process-compose itself.

Wasn't this used to be the case before? I vaguely remember process restarts never being infinite to begin with (I've seen processes enter into 'exited' state in process-compose window).

In any case, this change only affects services. Should we make it a default in process-compose-flake? Actually why not make it a default in process-compose itself?

Incidentally, there's no guarantee that a new service added to the repo will follow the same max_restarts convention. It is easy to miss that, so we should think about solving this more fundamentally.

Originally posted by @srid in #311 (review)

@srid srid pinned this issue Sep 7, 2024
@shivaraj-bh
Copy link
Member

How about having the common settings in

default = {
namespace = lib.mkDefault config.namespace;
};

Except for the exec.command most of the other things are common across services:

readiness_probe = {
exec.command = "${config.package}/bin/redis-cli -p ${toString config.port} ping";
initial_delay_seconds = 2;
period_seconds = 10;
timeout_seconds = 4;
success_threshold = 1;
failure_threshold = 5;
};
# https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy
availability = {
restart = "on_failure";
max_restarts = 5;
};
};

@shivaraj-bh
Copy link
Member

Or perhaps file an issue in process-compose itself asking what the recommend default should be

F1bonacc1/process-compose#242

@srid
Copy link
Member Author

srid commented Sep 7, 2024

Ideal solution: upstream a sensible value for max_restarts.

If that is not practical, yes, we can make these common settings to be shared.

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 a pull request may close this issue.

2 participants