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

Produce kernelinfo on kernel ready #2834

Merged
merged 1 commit into from
Mar 14, 2023
Merged

Conversation

colombod
Copy link
Member

No description provided.

@shyamnamboodiripad
Copy link
Contributor

Fixes #2831

@colombod
Copy link
Member Author

Fixes #2831

maybe ..

"event" => {
"kernelInfo" => $kernelInfo,
"kernelInfos" => $kernelInfo
Copy link
Member Author

Choose a reason for hiding this comment

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

@brettfo am I doing this right?

@colombod colombod marked this pull request as ready for review March 14, 2023 17:53
@colombod colombod force-pushed the kernel_info branch 2 times, most recently from d843531 to e18ca77 Compare March 14, 2023 19:13
@colombod colombod enabled auto-merge (squash) March 14, 2023 19:18
.Take(1)
.Subscribe(e =>
{
kernelReadyReceived = true;
_kernelReady = e;
Copy link
Contributor

@shyamnamboodiripad shyamnamboodiripad Mar 14, 2023

Choose a reason for hiding this comment

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

Since this is all within the same method, could we use a local instead of the field for kernelReady?

We already cache all kernel infos that we have seen so far in _remoteKernelInfos. So, it feels a bit strange that at least some of those kernel infos would also be avbailable via the _kernelReady field. Plus the filed is not used outside this method anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

(Looks like making the above change would also solve the nullability error that caused the build break in CI)

Copy link
Member Author

Choose a reason for hiding this comment

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

but the connector can be reused that is why is stored, you will see that event only when the process is started

Copy link
Contributor

@shyamnamboodiripad shyamnamboodiripad Mar 14, 2023

Choose a reason for hiding this comment

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

All kernel infos are already avaialble in _remoteKernelInfos, so you could just fetch it from there (like we do inside CreateProxyKernelAsync below), could you not?

Copy link
Contributor

Choose a reason for hiding this comment

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

In other words, I think we can use a local for the first time case when the process is started (since we need to wait until the kernelReady is received in that case). For all other cases where process is already present but connector is reused, we can use the previously cached kernelInfos present inside _remoteKernelInfos.

Copy link
Contributor

@shyamnamboodiripad shyamnamboodiripad left a comment

Choose a reason for hiding this comment

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

Thanks for fixing! 👍🏾

kernel ready contains kernelInfo and is used to setup proxys at connection time

Update src/dotnet-interactive/Connection/StdIoKernelConnector.cs

Co-authored-by: Shyam N <shyamnamboodiripad@users.noreply.github.com>
Update src/dotnet-interactive/Connection/StdIoKernelConnector.cs

Co-authored-by: Shyam N <shyamnamboodiripad@users.noreply.github.com>
nullability


check for null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants