fix(orchestrator): satisfy adapter type contracts
prd-number-check / require-numbered-prds (pull_request) Successful in 12s
lint / lint (push) Successful in 1m9s
test / image-input-builds (pull_request) Successful in 1m50s
test / unit (pull_request) Successful in 2m29s
test / integration-docker (pull_request) Successful in 55s
test / coverage (pull_request) Failing after 18s
tracker-policy-pr / check-pr (pull_request) Successful in 21s

This commit is contained in:
2026-07-26 23:12:30 +00:00
parent 40a607962f
commit adf68ff240
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -401,6 +401,8 @@ class Handler(http.server.BaseHTTPRequestHandler):
self._write_json(408, {"error": "request body read timed out"}) self._write_json(408, {"error": "request body read timed out"})
return return
try: try:
status: int
payload: Json
status, payload = dispatch( status, payload = dispatch(
server.orchestrator, method, self.path, body, role=role) server.orchestrator, method, self.path, body, role=role)
except Exception as e: # noqa: BLE001 — the control plane must stay up except Exception as e: # noqa: BLE001 — the control plane must stay up
@@ -472,7 +474,7 @@ class OrchestratorServer(socketserver.ThreadingMixIn, http.server.HTTPServer):
return request, client_address return request, client_address
def process_request( def process_request(
self, request: socket.socket, client_address: typing.Any, self, request: typing.Any, client_address: typing.Any,
) -> None: ) -> None:
# Bound concurrency before ThreadingMixIn creates a worker. Backpressure # Bound concurrency before ThreadingMixIn creates a worker. Backpressure
# stays in the accept loop instead of allocating an unbounded thread per # stays in the accept loop instead of allocating an unbounded thread per
@@ -485,7 +487,7 @@ class OrchestratorServer(socketserver.ThreadingMixIn, http.server.HTTPServer):
raise raise
def process_request_thread( def process_request_thread(
self, request: socket.socket, client_address: typing.Any, self, request: typing.Any, client_address: typing.Any,
) -> None: ) -> None:
try: try:
super().process_request_thread(request, client_address) super().process_request_thread(request, client_address)
+1 -1
View File
@@ -264,7 +264,7 @@ class TestServerRoundTrip(unittest.TestCase):
threading.Thread(target=server.serve_forever, daemon=True).start() threading.Thread(target=server.serve_forever, daemon=True).start()
self.addCleanup(server.shutdown) self.addCleanup(server.shutdown)
conn = http.client.HTTPConnection( conn = http.client.HTTPConnection(
server.server_address[0], server.server_address[1], timeout=5, str(server.server_address[0]), server.server_address[1], timeout=5,
) )
self.addCleanup(conn.close) self.addCleanup(conn.close)
conn.putrequest("POST", "/bottles") conn.putrequest("POST", "/bottles")