-
-
Notifications
You must be signed in to change notification settings - Fork 550
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
[add] detect and recover from kernel auto restarts #5558
base: main
Are you sure you want to change the base?
Conversation
test can't seem to identify next on subject. For now, check before callingnteract/packages/epics/src/kernel-lifecycle.ts Lines 116 to 121 in 7fc02ba
This comment was generated by todo based on a
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nteract/site/ATkM8NZdPXaB51a4yLx9MrX7cLCi |
test can't seem to identify next on subject. For now, check before callingnteract/packages/epics/src/kernel-lifecycle.ts Lines 116 to 121 in a44dbb5
This comment was generated by todo based on a
|
Please let me know if you need me to provide any more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great and I learned a bit more RxJS while reviewing. Thanks!
{ | ||
header: { msg_type: "status" }, | ||
content: { execution_state: "starting" } | ||
}) as Subject<any>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, this works nicely for tests. 😎
/** | ||
* Jupyter has options to automatically restart the kernel on crash for a max-retry of 5 retries. | ||
* Monitor for the kernel to have successfully restarted (sent as a "restarting" status followed by a "starting"). | ||
* If all 5 retries fail, the kernel status is reported as "dead". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* Monitor for the kernel to have successfully restarted (sent as a "restarting" status followed by a "starting"). | ||
* If all 5 retries fail, the kernel status is reported as "dead". | ||
* | ||
* @oaram {ActionObservable} action$ ActionObservable for LAUNCH_KERNEL_SUCCESSFUL action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oaram
-> @param
|
||
return kernel.channels.pipe( | ||
kernelStatuses(), | ||
pairwise(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow this one is new to me, very cool.
), | ||
tap(() => { | ||
// to avoid getting stuck in the "starting" state, nudge kernel with kernel_info_request to bring the status to Idle. | ||
// TODO: test can't seem to identify next on subject. For now, check before calling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since channels is a plain observable in some of the tests rather than a subject, it doesn't have .next
.
@rgbkrk Thanks for taking the time to review! @shibbas Heads up that automatic releases are now enabled on the repo (see #5568 for more info). To support automated releases, please make sure that the commits in this PR adhere to the conventional commit format (see https://www.conventionalcommits.org/en/v1.0.0/). Once this PR is merged, a release will be triggered for the modified packages based on the commit message. |
Checklist
Context
This is PR for the issue mentioned at #5548
When the Jupyter option for kernel auto-restart is turned on (which it by default), then the kernel will be restarted on the server automatically. You get a "restarting" status followed by a "starting" message from the kernel. Server uses "restarting" only for auto-restart scenarios.
This PR adds a new epic to detect the successful auto-restart and nudge the kernel back into the idle state. Also raises an action that applications can use to raise notifications since the Kernel state is lost.
Only applicable to Jupyter host type.
Before
// Side note: The CSS for nteract_on_jupyter application seems to be broken in dev setup hence the weird cell layout.
After kernel auto-restart, status gets stuck in starting state and cell execution does not proceed.
After
After kernel auto-restart, kernel is back to Idle and cell execution can continue.