Skip to content

Commit

Permalink
Bug Bash clean-up (jupyter-server#374)
Browse files Browse the repository at this point in the history
* bug bash updates

* Bump to 0.19.5

* drop the unused 'terminated' state
  • Loading branch information
Zsailer authored and GitHub Enterprise committed May 16, 2022
1 parent a9b3d4a commit bc19d32
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 32 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.19.4" # pragma: no cover
__version__ = "0.19.5" # pragma: no cover
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def post_start_kernel(self, **kwargs):
# post_start_kernel starts the kernel_restarter.
await super().post_start_kernel(**kwargs)

heartbeat_timeout = Int(180).tag(config=True)
heartbeat_timeout = Int(1800).tag(config=True)
heartbeat = Instance(HBChannel, default_value=None, allow_none=True)

async def start_heartbeat(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async def poll(self):
if not self._connected_once:
self._emit(
state=constants.KERNEL_STATE.CONNECTING,
msg="",
msg="Waiting for a kernel heartbeat.",
)
# Kernel is disconnected due to timeout.
if km.heartbeat_timeout < (now - self._start_time):
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.19.4"
current = "0.19.5"
regex = '''
(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
((?P<channel>a|b|rc|.dev)(?P<release>\d+))?
Expand Down
43 changes: 16 additions & 27 deletions src/status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
import { EventListener } from './eventlistener';

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

// 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 Expand Up @@ -172,34 +172,23 @@ export const kernelStatusPlugin: JupyterFrontEndPlugin<void> = {
return;
}

// Bail if we are connecting.
const connectionStatus =
panel.sessionContext.session?.kernel?.connectionStatus;
if (data.state == 'connecting' && connectionStatus === 'connecting') {
console.log(
`bailing because we are connecting to kernel ${data.kernel_id}`
);
banner.setState(data);
return;
}

if (data.state == 'connected' && connectionStatus === 'connected') {
banner.setState(data);
banner.hide();
return;
}
// Open up the banner.
banner.show();

if (data.status == 'terminated') {
banner.show();
console.log(
`hiding banner for path ${panel.sessionContext.path} for kernel ${data.kernel_id}`
);
banner.hide();
return;
// Using a switch here for now. We may want
// to allow different states to do different things
// with the banner, so having a switch here is
// convenient.
switch (data.state) {
case 'connected':
banner.setState(data);
banner.hide();
return;

default:
// Update the banner state
banner.setState(data);
}
// Update the banner state
banner.setState(data);
banner.show();

let dialog = dialogProperty.get(panel);
if (dialog) {
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.19.4
0.19.5

0 comments on commit bc19d32

Please sign in to comment.