We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 202557a + be871aa commit 3eda492Copy full SHA for 3eda492
splunklib/client.py
@@ -618,7 +618,15 @@ def restart(self, timeout=None):
618
while datetime.now() - start < diff:
619
try:
620
self.login()
621
- if not self.restart_required:
+ if self.restart_required:
622
+ # Prevent a burst of requests from bombarding Splunk.
623
+ # Splunk does not stop the API immediately when /services/server/control/restart
624
+ # responds, thus the login call (above) will still succeed until the server
625
+ # is actually stopped. Based on the presence of restart_required message,
626
+ # that we have added before calling restart, we know that the server did not stop yet.
627
+ sleep(1)
628
+ continue
629
+ else:
630
return result
631
except Exception as e:
632
sleep(1)
0 commit comments