Terminate process when main process raises error in ServableModuleValidator (#14217)
Co-authored-by: otaj <6065855+otaj@users.noreply.github.com>
This commit is contained in:
parent
1745d192f9
commit
7d17310966
|
@ -27,7 +27,7 @@ jobs:
|
||||||
- {python-version: "3.8", pytorch-version: "1.10"}
|
- {python-version: "3.8", pytorch-version: "1.10"}
|
||||||
- {python-version: "3.9", pytorch-version: "1.11"}
|
- {python-version: "3.9", pytorch-version: "1.11"}
|
||||||
- {python-version: "3.9", pytorch-version: "1.12"}
|
- {python-version: "3.9", pytorch-version: "1.12"}
|
||||||
timeout-minutes: 30
|
timeout-minutes: 40
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Workaround for https://github.com/actions/checkout/issues/760
|
- name: Workaround for https://github.com/actions/checkout/issues/760
|
||||||
|
|
|
@ -47,7 +47,7 @@ class ServableModuleValidator(Callback):
|
||||||
server: Literal["fastapi", "ml_server", "torchserve", "sagemaker"] = "fastapi",
|
server: Literal["fastapi", "ml_server", "torchserve", "sagemaker"] = "fastapi",
|
||||||
host: str = "127.0.0.1",
|
host: str = "127.0.0.1",
|
||||||
port: int = 8080,
|
port: int = 8080,
|
||||||
timeout: int = 10,
|
timeout: int = 20,
|
||||||
exit_on_failure: bool = True,
|
exit_on_failure: bool = True,
|
||||||
):
|
):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
@ -109,7 +109,8 @@ class ServableModuleValidator(Callback):
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
pass
|
pass
|
||||||
if time.time() - t0 > self.timeout:
|
if time.time() - t0 > self.timeout:
|
||||||
raise Exception(f"The Server didn't start in {self.timeout}")
|
process.kill()
|
||||||
|
raise Exception(f"The server didn't start within {self.timeout} seconds.")
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
payload = servable_module.configure_payload()
|
payload = servable_module.configure_payload()
|
||||||
|
|
Loading…
Reference in New Issue