Skip to content

Commit bd87a2c

Browse files
authored
Fix on bug causing Kernel launch to timeout (#141)
1 parent 5a2aa4b commit bd87a2c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

gateway_provisioners/yarn.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -587,15 +587,16 @@ def _query_app_by_name(self, kernel_id: str) -> dict | None:
587587
)
588588
else:
589589
data = response.data
590-
if (
591-
isinstance(type, dict)
592-
and isinstance(data.get("apps"), dict)
593-
and "app" in data.get("apps")
594-
):
595-
for app in data["apps"]["app"]:
596-
if app.get("name", "").find(kernel_id) >= 0 and app.get("id") > top_most_app_id:
597-
target_app = app
598-
top_most_app_id = app.get("id")
590+
if isinstance(data, dict):
591+
apps = data.get("apps")
592+
if isinstance(apps, dict) and "app" in apps:
593+
for app in data["apps"]["app"]:
594+
if (
595+
app.get("name", "").find(kernel_id) >= 0
596+
and app.get("id") > top_most_app_id
597+
):
598+
target_app = app
599+
top_most_app_id = app.get("id")
599600
return target_app
600601

601602
def _query_app_by_id(self, app_id: str) -> dict | None:

tests/test_yarn_provisioners.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717

1818
@pytest.mark.parametrize("seed_env", [YARN_SEED_ENV])
19-
@pytest.mark.xfail()
2019
async def test_lifecycle(init_api_mocks, response_manager, get_provisioner, seed_env):
2120
name = "yarn"
2221
kernel_id = str(uuid4())

0 commit comments

Comments
 (0)