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

fix(install): Remove unneeded "start halyard" after install #604

Merged
merged 1 commit into from
Jul 14, 2017

Conversation

lwander
Copy link
Member

@lwander lwander commented Jul 14, 2017

The start halyard command was breaking the install path after the
postInstall.sh now correctly starts Halyard after it's installed.

@lwander lwander requested a review from ewiseblatt July 14, 2017 16:23
Copy link

@ewiseblatt ewiseblatt left a comment

Choose a reason for hiding this comment

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

Does this result in an infinite loop if halyard is never ready (or install_halyard did not attempt to start halyard)?

@lwander
Copy link
Member Author

lwander commented Jul 14, 2017

If the install fails (like we saw before) the install script should have exited already. If halyard has another bug that prevents it from starting, removing this line doesn't introduce that behavior, that would have already happened.

I'll add a timeout to wait section as a friendly precaution, though.

@ewiseblatt
Copy link

I dont see an update wiht the timeout.
My concerns was also if the install script were changed to not attempt the start.
The process could still terminate abnormally. Timeout is sufficient guard.

@lwander lwander force-pushed the remove-unneeded-start-halyard branch from 13fe5b7 to fc53248 Compare July 14, 2017 17:12
@lwander
Copy link
Member Author

lwander commented Jul 14, 2017

Sorry got sidetracked & never pushed the timeout guard

@lwander
Copy link
Member Author

lwander commented Jul 14, 2017

(It's here now)

@lwander
Copy link
Member Author

lwander commented Jul 14, 2017

h/o don't merge yet

WAIT_NOW=$(date +%s)
WAIT_TIME=$(( $WAIT_NOW - $WAIT_START ))

if [ "$WAIT_TIME" > "$HALYARD_STARTUP_TIMEOUT_SECONDS" ]; then

Choose a reason for hiding this comment

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

I htink this should be $WAIT_TIME -gt $HALYARD_STARTUP_TIMEOUT_SECS

Choose a reason for hiding this comment

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

oh never mind, this is a string compare

Choose a reason for hiding this comment

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

if you are spinning on a sleep, you can just count iterations. Approximation is good enough.

Copy link
Member Author

Choose a reason for hiding this comment

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

No you're right it should be -gt

I figured counting approximations would break if someone changed the sleep time per iteration. This felt a little more consistent.

The `start halyard` command was breaking the install path after the
`postInstall.sh` now correctly starts Halyard after it's installed.
@lwander lwander force-pushed the remove-unneeded-start-halyard branch from fc53248 to 034374d Compare July 14, 2017 17:24
@lwander
Copy link
Member Author

lwander commented Jul 14, 2017

All set on my end

WAIT_NOW=$(date +%s)
WAIT_TIME=$(( $WAIT_NOW - $WAIT_START ))

if [ "$WAIT_TIME" -gt "$HALYARD_STARTUP_TIMEOUT_SECONDS" ]; then

Choose a reason for hiding this comment

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

-gt is on numbers but you have strings here.
I think you should count iterations.

Copy link
Member Author

Choose a reason for hiding this comment

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

String comparison is lexicographic, and bash variables are untyped. This does an integer comparison.

Why do you prefer counting iterations?

Copy link

@ewiseblatt ewiseblatt left a comment

Choose a reason for hiding this comment

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

discussed offline

@lwander lwander merged commit 5cff699 into spinnaker:master Jul 14, 2017
@lwander lwander deleted the remove-unneeded-start-halyard branch July 14, 2017 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants