Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display python error message when kernel dies #7646

Merged
merged 2 commits into from
Sep 24, 2021
Merged

Display python error message when kernel dies #7646

merged 2 commits into from
Sep 24, 2021

Conversation

DonJayamanne
Copy link
Contributor

Fixes #7318

@DonJayamanne DonJayamanne requested a review from a team as a code owner September 23, 2021 21:58
// Show the error message
// eslint-disable-next-line @typescript-eslint/no-explicit-any
void this.applicationShell.showErrorMessage(
exc instanceof Error ? exc.message : (exc as any).toString()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaner than displaying a to string version of the error.

@@ -245,9 +245,7 @@ export class KernelExecution implements IDisposable {
@captureTelemetry(Telemetry.RestartJupyterTime)
private async restartExecution(notebook: INotebook): Promise<void> {
// Just use the internal session. Pending cells should have been canceled by the caller
await notebook.session.restart(this.interruptTimeout).catch((exc) => {
traceWarning(`Error during restart: ${exc}`);
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bug, we were swalling errors when restarting kernels, its as though everything went fine, when infact the kernel actually died.

const message =
'exitCode' in options
? `Kernel died with exit code ${options.exitCode}. ${options.reason}`
? `Kernel died (code: ${options.exitCode}). ${reason}${options.reason}`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to incldue error message in the first line (in python stack traces the error message is at the end, this way we extract the last line & put it on top of the error message)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it look like in the UI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, meant to upload that, took the screenshots earlier.
here they are
Screen Shot 2021-09-23 at 14 42 11
Screen Shot 2021-09-23 at 14 50 40

@DonJayamanne DonJayamanne requested review from DavidKutu, IanMatthewHuff, joyceerhl and rchiodo and removed request for a team September 23, 2021 22:00
@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2021

Codecov Report

Merging #7646 (5a2b8f7) into main (5ea9ffc) will increase coverage by 0%.
The diff coverage is 16%.

@@          Coverage Diff          @@
##            main   #7646   +/-   ##
=====================================
  Coverage     68%     68%           
=====================================
  Files        363     363           
  Lines      22546   22535   -11     
  Branches    3430    3431    +1     
=====================================
- Hits       15490   15489    -1     
+ Misses      5724    5715    -9     
+ Partials    1332    1331    -1     
Impacted Files Coverage Δ
...tascience/jupyter/kernels/kernelCommandListener.ts 56% <0%> (-1%) ⬇️
src/client/datascience/kernel-launcher/types.ts 59% <0%> (-5%) ⬇️
...ent/datascience/jupyter/kernels/kernelExecution.ts 69% <100%> (+<1%) ⬆️
.../kernel-launcher/localKnownPathKernelSpecFinder.ts 89% <0%> (-3%) ⬇️
...datascience/jupyter/liveshare/hostJupyterServer.ts 69% <0%> (+<1%) ⬆️
src/client/datascience/jupyter/kernels/helpers.ts 72% <0%> (+1%) ⬆️
src/client/datascience/raw-kernel/rawSocket.ts 84% <0%> (+1%) ⬆️
...datascience/editor-integration/codelensprovider.ts 71% <0%> (+1%) ⬆️
.../localPythonAndRelatedNonPythonKernelSpecFinder.ts 81% <0%> (+2%) ⬆️

@DonJayamanne DonJayamanne merged commit fc81b29 into main Sep 24, 2021
@DonJayamanne DonJayamanne deleted the issue7318 branch September 24, 2021 01:47
@DonJayamanne DonJayamanne mentioned this pull request Feb 21, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a better error message when kernel dies
4 participants