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

Binary pack script opt #4010

Closed
wants to merge 2 commits into from
Closed

Conversation

wey-gu
Copy link
Contributor

@wey-gu wey-gu commented Mar 11, 2022

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

close #4003
close #4009

Description:

  • stop service before uninstalling packages
  • try best to avoid storage initial start attempt failed due to meta is not yet ready(and the retry next attempt will be quite long, later)

How do you solve it?

  • Add pre uninstall script to stop service before uninstall
  • Softly enforce waiting for port listening during service start with a best effort/timer

Special notes for your reviewer, ex. impact of this fix, design document, etc:

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • Manual Test(to be done later)

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

ex. Fixed the bug .....

  • Binary package script optimized.

@wey-gu wey-gu added the do not review PR: not ready for the code review yet label Mar 11, 2022
@wey-gu
Copy link
Contributor Author

wey-gu commented Mar 11, 2022

will manually test when I got bandwidth to, plz don't review now.

for daemon in ${daemons[@]}
do
if [[ ! -f $install_dir/scripts/nebula.service ]] ; then
$install_dir/scripts/nebula.service stop ${daemon}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This operation can be dangerous in a production environment. I suggest that we do not do this implicitly.

@@ -141,6 +141,8 @@ function start_daemon {
local command="${executable} --flagfile ${config}"
INFO "Starting ${daemon_name}..."
eval ${command}
local port=$(get_port_from_config ${config})
wait_for_port_listening ${port} 20 || WARN "Timed out waiting for ${daemon_name} to finish starting, but it may still be running"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer to implement this logic in nebula process.
and the behavior should be same with running in container.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or just like readinessprobe in k8s, curl a http interface?

@Sophie-Xie Sophie-Xie added this to the v3.1.0 milestone Mar 21, 2022
@Sophie-Xie Sophie-Xie removed this from the v3.1.0 milestone Mar 30, 2022
@wey-gu
Copy link
Contributor Author

wey-gu commented Apr 1, 2022

this will be revisited later when I have bandwidth to think about it.
Thanks for the reviews already ;)

@wey-gu
Copy link
Contributor Author

wey-gu commented Dec 9, 2022

closing it for now

@wey-gu wey-gu closed this Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not review PR: not ready for the code review yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add order for script/service start all Add service stop in binary/rpm/deb uninstall
4 participants