-
Notifications
You must be signed in to change notification settings - Fork 189
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
implemented functions to restart abnormally terminated node automatically. #1101
Conversation
@sirano11 Im not tested yet, but just worried about duplicating pid files situation (e.g. Running all k*nd series in a machine with same DATA_DIR and autorestart option and then maybe duplication problem happen) So my idea is like below. in in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me
build/packaging/linux/bin/kbnd
Outdated
fi | ||
AUTO_RESTART_DAEMON_PID_NUM=$(eval "cat $auto_restart_daemon_pidfile") | ||
if [[ ! -z "$AUTO_RESTART_DAEMON_PID_NUM" ]]; then | ||
export auto_restart_daemon_pid=$(eval "ps -p $AUTO_RESTART_DAEMON_PID_NUM -o pid=") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to use $(eval "cmd...")
instead of $(cmd...)
?
It seems like this pattern was already in use in other places, but I think $(cmd)
should have the same result (capturing output of the command to an environment variable) while being simpler to read and avoiding the use of eval
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aluminous
I removed eval. thanks.
1524f44
Proposed changes
This PR implemented functions to restart abnormally terminated node in klaytn node daemon file.(kend, kcnd...)
To restart abnormally terminated node automatically, it need to set
AUTO_RESTART_NODE
,AUTO_RESTART_INTERVAL
in kxxd.conf file.I tested this script in variable environments. Please check the attached log and below log.
Types of changes
Please put an x in the boxes related to your change.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
$ make test
)Related issues
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...