Avoid waits during node secondary
Waiting for the daemons to stop took too much time on some nodes and could throw off the lockstep. Instead, leverage background=True to run the systemctl os_commands in the background (when they complete is irrelevant), stop the Metadata API first, and don't delay during its stop at all.
This commit is contained in:
@ -22,7 +22,6 @@
|
||||
import gevent.pywsgi
|
||||
import flask
|
||||
import sys
|
||||
import time
|
||||
import psycopg2
|
||||
|
||||
from threading import Thread
|
||||
@ -123,9 +122,7 @@ class MetadataAPIInstance(object):
|
||||
self.logger.out("Stopping Metadata API at 169.254.169.254:80", state="i")
|
||||
try:
|
||||
self.md_http_server.stop()
|
||||
time.sleep(0.1)
|
||||
self.md_http_server.close()
|
||||
time.sleep(0.1)
|
||||
self.md_http_server = None
|
||||
self.logger.out("Successfully stopped Metadata API", state="o")
|
||||
except Exception as e:
|
||||
|
Reference in New Issue
Block a user