Skip to content

Commit 9f1cb7f

Browse files
ZsailerGitHub Enterprise
authored andcommitted
Synchronizer should ignore dead/terminated kernels from Notebook Service. (jupyter-server#334)
* minor logging cleanup * minor logging cleanup * list only healthy kernels * Bump to 0.17.2
1 parent 886b185 commit 9f1cb7f

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.17.1" # pragma: no cover
1+
__version__ = "0.17.2" # pragma: no cover

data_studio_jupyter_extensions/app.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ async def fetch_running_kernels(self) -> None:
4343
kernels = json_decode(response.body)
4444
# Hydrate kernelmanager for all remote kernels
4545
for item in kernels:
46-
kernel = self.kernel_record_class(process_id=item["id"], alive=True)
47-
self._kernel_records.update(kernel)
46+
# Notebook Service returns all kernels—terminated, failed, etc.
47+
# Only list kernels that are in a working state. Ignore stale or terminated kernels.
48+
if item["status"] in {"starting", "ready", "running"}:
49+
kernel = self.kernel_record_class(process_id=item["id"], alive=True)
50+
self._kernel_records.update(kernel)
4851
except Exception as err:
4952
self.log.debug(
5053
f"Synchronizer failed. Skipping for now. Here is the following error: {str(err)}"

data_studio_jupyter_extensions/configurables/notebook_service.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ async def fetch_token(self): # pragma: no cover
6565
audience = "notebook-service-int datastudio-int"
6666
mayActSub = "2320309053"
6767
url = "https://iam.corp.apple.com/oauth2/token"
68-
6968
data = dict(
7069
scope=scope,
7170
audience=audience,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ testpaths = [
2323
]
2424

2525
[tool.tbump.version]
26-
current = "0.17.1"
26+
current = "0.17.2"
2727
regex = '''
2828
(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
2929
((?P<channel>a|b|rc|.dev)(?P<release>\d+))?

src/status.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { ISessionContext, ReactWidget } from '@jupyterlab/apputils';
3131
import { TelemetryListener } from './telemetrylistener';
3232

3333
// This is managed by tbump config in pyproject.toml
34-
const VERSION = '0.17.1';
34+
const VERSION = '0.17.2';
3535

3636
// Define the error states
3737
// https://github.pie.apple.com/pie-data-studio/notebook-service/blob/761d63604966db5918d2e491c0f89cce454b7f67/app/com/apple/datastudio/model/ResourceState.scala#L20

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.17.1
1+
0.17.2

0 commit comments

Comments
 (0)