Close PostgreSQL gate pipes cleanly after a nonblocking refusal

This commit is contained in:
omar
2026-09-25 18:57:59 +03:00
parent 955c3636a1
commit c8c482c387
+3 -5
View File
@@ -140,12 +140,10 @@ class Renewal:
return True
finally:
try:
gate.stdin.write('ROLLBACK;\n\\q\n')
gate.stdin.flush()
gate.communicate(timeout=5)
except (BrokenPipeError, subprocess.TimeoutExpired):
gate.communicate('ROLLBACK;\n\\q\n', timeout=5)
except subprocess.TimeoutExpired:
gate.kill()
gate.wait()
gate.communicate()
def get_vm(self, vmid):
return json.loads(run(['pvesh', 'get', f"/nodes/{self.binding['node']}/qemu/{vmid}/config", '--output-format', 'json']))