Skip to content

Commit 41e7604

Browse files
committed
Always sleep while restarting
The /services/server/control/restart endpoint does not stop the API immediately. As a result, a login() call may still succeed just before the restart takes effect. This change introduces an additional sleep to prevent a burst of requests from reaching the server while it is in the process of restarting.
1 parent 27af330 commit 41e7604

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

splunklib/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ def restart(self, timeout=None):
620620
self.login()
621621
if not self.restart_required:
622622
return result
623+
sleep(1)
623624
except Exception as e:
624625
sleep(1)
625626
raise Exception("Operation time out.")

0 commit comments

Comments
 (0)