Skip to content

Conversation

@ruvceskistefan
Copy link
Contributor

Problems were:

  • the implementation of sleep in the case when both ping and sleep are missing in safe_sleep function
  • usage of standard sleep function instead of safe_sleep in bash script

Related issue: #1698

After this change, safe_sleep is implemented as separate executable bash script, and scripts run-helper.sh and update.sh are using that function instead of standard sleep function.

@ruvceskistefan ruvceskistefan requested a review from a team as a code owner February 22, 2022 13:53
elif [[ $returnCode == 2 ]]; then
echo "Runner listener exit with retryable error, re-launch runner in 5 seconds."
safe_sleep
./bin/safe_sleep.sh 5
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm always a bit iffy on relative paths, does is work fine if I start run.sh with an absolute path from a different directory?

Copy link
Contributor Author

@ruvceskistefan ruvceskistefan Feb 23, 2022

Choose a reason for hiding this comment

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

I changed to absolute paths and changed the location of the safe_sleep script, so it is not in bin folder.

@thboop thboop requested a review from fhammerl February 23, 2022 21:33
@fhammerl fhammerl enabled auto-merge (squash) March 1, 2022 13:02
Copy link
Contributor

@fhammerl fhammerl left a comment

Choose a reason for hiding this comment

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

👍

@Mart-Bogdan
Copy link

Mart-Bogdan commented Nov 27, 2025

How this got merged? This is definitely endless loop.

SECONDS=0
while [[ $SECONDS != $1 ]]; do
:
done

EDIT. Oh, SECONDS is autoincremented by bash. didn't know that.

@elupus
Copy link

elupus commented Dec 3, 2025

Why is this not attempting to yield using a potentially available sleep call on the systems where that is available. Ie close to all systems. Could just do that inside the new loop.

Busy waiting is always really bad.

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.

4 participants