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

contextutil.safe_while does not sleep between tries if needed to loop infinitely #1995

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

kshtsk
Copy link
Contributor

@kshtsk kshtsk commented Aug 6, 2024

This PR provides fixes for several issues introduced in #1816:

  1. make use of tries argument in list_lock() instead of hardcoded infinite loop
  2. make safe_while() sleep between tries again when tries < 0, i.e. in case of infinite retries
  3. (unrelated) report number of spent tries by safe_while correctly
  4. try to get list_lock() only once when we're trying get architectures by given machine type for teuthology-suite.

https://tracker.ceph.com/issues/67377

@kshtsk kshtsk requested a review from zmc August 6, 2024 23:21
@kshtsk
Copy link
Contributor Author

kshtsk commented Aug 6, 2024

@zmc what I didn't understand from #1816, was it desired to run tries infinitely by default, or it is just 10 times?

@kshtsk kshtsk changed the title fix contextutil contextutil.safe_while does not sleep between tries if needed to loop infinitely Aug 6, 2024
Kyr Shatskyy added 3 commits August 7, 2024 01:49
This patch fixes an issue introduced within PR ceph#1816,
that when tries are < 0 (e.g. -1) there is no sleep
occurred between tries.

It also fixes error message, so we repot correct
number of tries we've done now.

Fixes: ee43f87

Signed-off-by: Kyr Shatskyy <[email protected]>
We only want to try to list_locks() for getting arch by
machine_type when scheduling a suite. Otherwise we've
got into an infinite loop and console log flooded
with useless error messages.

Signed-off-by: Kyr Shatskyy <[email protected]>
The list_locks has been updated with new argument 'tries' in PR#1816,
but by unfortunate mistake hasn't been used yet.

Fixes: 55886ea

Signed-off-by: Kyr Shatskyy <[email protected]>
@kshtsk kshtsk merged commit 67db276 into ceph:main Aug 14, 2024
9 checks passed
@kshtsk kshtsk deleted the wip-fix-1816 branch August 14, 2024 22:53
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.

2 participants