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

Add elapsed time status updates for distributed_wait #541

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

afreiberger
Copy link
Contributor

addresses issue #540 to provide operator feedback on elapsed time of long distributed wait times.

@afreiberger
Copy link
Contributor Author

I think this may break tests, as it would no longer match 0 second sleep for leader unit, as the sleep would be bypassed as remaining = 0

@afreiberger
Copy link
Contributor Author

updated leader test to expect no waiting.

Copy link
Contributor

@ajkavanagh ajkavanagh left a comment

Choose a reason for hiding this comment

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

This is a nice patch which would enhance the operator's experience. Just a couple of minor observations. Thanks.

# update status every 60 seconds with wait time elapsed
remaining_wait = calculated_wait
elapsed = 0
while remaining_wait:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would be more robust if it said:

while remaining_wait > 0:
    ...

I know that by inspection the code will work, it's just the defensive programmer in me!

@@ -531,7 +531,7 @@ def test_distributed_wait(self, log, modulo_distribution, sleep,
is_leader.return_value = True
cluster_utils.distributed_wait(modulo=9, wait=23)
modulo_distribution.assert_not_called()
sleep.assert_called_with(0)
sleep.assert_not_called(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

It would probably be good to check that the looping does actually work here. i.e. verify that it works for an odd number of "not divisible by" 60 seconds wait.

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