Skip to content

Commit

Permalink
Synchronizer should ignore dead/terminated kernels from Notebook Serv…
Browse files Browse the repository at this point in the history
…ice. (jupyter-server#334)

* minor logging cleanup

* minor logging cleanup

* list only healthy kernels

* Bump to 0.17.2
  • Loading branch information
Zsailer authored and GitHub Enterprise committed Apr 27, 2022
1 parent 886b185 commit 9f1cb7f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion data_studio_jupyter_extensions/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.17.1" # pragma: no cover
__version__ = "0.17.2" # pragma: no cover
7 changes: 5 additions & 2 deletions data_studio_jupyter_extensions/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ async def fetch_running_kernels(self) -> None:
kernels = json_decode(response.body)
# Hydrate kernelmanager for all remote kernels
for item in kernels:
kernel = self.kernel_record_class(process_id=item["id"], alive=True)
self._kernel_records.update(kernel)
# Notebook Service returns all kernels—terminated, failed, etc.
# Only list kernels that are in a working state. Ignore stale or terminated kernels.
if item["status"] in {"starting", "ready", "running"}:
kernel = self.kernel_record_class(process_id=item["id"], alive=True)
self._kernel_records.update(kernel)
except Exception as err:
self.log.debug(
f"Synchronizer failed. Skipping for now. Here is the following error: {str(err)}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ async def fetch_token(self): # pragma: no cover
audience = "notebook-service-int datastudio-int"
mayActSub = "2320309053"
url = "https://iam.corp.apple.com/oauth2/token"

data = dict(
scope=scope,
audience=audience,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ testpaths = [
]

[tool.tbump.version]
current = "0.17.1"
current = "0.17.2"
regex = '''
(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
((?P<channel>a|b|rc|.dev)(?P<release>\d+))?
Expand Down
2 changes: 1 addition & 1 deletion src/status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { ISessionContext, ReactWidget } from '@jupyterlab/apputils';
import { TelemetryListener } from './telemetrylistener';

// This is managed by tbump config in pyproject.toml
const VERSION = '0.17.1';
const VERSION = '0.17.2';

// Define the error states
// https://github.pie.apple.com/pie-data-studio/notebook-service/blob/761d63604966db5918d2e491c0f89cce454b7f67/app/com/apple/datastudio/model/ResourceState.scala#L20
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.17.1
0.17.2

0 comments on commit 9f1cb7f

Please sign in to comment.