forked from mtusi2026/mtusi2026lab7
Проверять смену сертификатов без рестарта и разделить бюджет health-check
This commit is contained in:
@@ -85,6 +85,22 @@ def metadata():
|
||||
)
|
||||
|
||||
|
||||
def lb_worker_pid():
|
||||
# Return only the public native worker PID, never raw admin socket output.
|
||||
script = """import socket
|
||||
s=socket.socket(socket.AF_UNIX);s.settimeout(5)
|
||||
s.connect('/proc/1/root/tmp/admin.sock');s.sendall(b'show info\\n')
|
||||
s.shutdown(socket.SHUT_WR);chunks=[]
|
||||
while True:
|
||||
part=s.recv(4096)
|
||||
if not part:break
|
||||
chunks.append(part)
|
||||
s.close()
|
||||
print(next(line.split(':',1)[1].strip() for line in b''.join(chunks).decode().splitlines() if line.startswith('Pid:')))
|
||||
"""
|
||||
return int(compose("exec", "-T", "identity-lb", "python", "-c", script))
|
||||
|
||||
|
||||
def reload_lb():
|
||||
compose(
|
||||
"exec",
|
||||
|
||||
Reference in New Issue
Block a user