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

Fix #11686. Trigger a cache update immediately after reading from cache. #11687

Merged
merged 1 commit into from
Oct 18, 2022

Conversation

rebornix
Copy link
Member

@rebornix rebornix commented Oct 18, 2022

Fixes #11686.

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • Title summarizes what is changing.
  • Has a news entry file (remember to thank yourself!).
  • Appropriate comments and documentation strings in the code.
  • Has sufficient logging.
  • Has telemetry for feature-requests.
  • Unit tests & system/integration tests are added/updated.
  • Test plan is updated as appropriate.
  • package-lock.json has been regenerated by running npm install (if dependencies have changed).

@codecov-commenter
Copy link

Codecov Report

Merging #11687 (8d7ed47) into main (ecad7ae) will increase coverage by 0%.
The diff coverage is 100%.

@@           Coverage Diff           @@
##            main   #11687    +/-   ##
=======================================
  Coverage     61%      62%            
=======================================
  Files        483      483            
  Lines      34362    34368     +6     
  Branches    5571     5573     +2     
=======================================
+ Hits       21245    21562   +317     
+ Misses     11018    10740   -278     
+ Partials    2099     2066    -33     
Impacted Files Coverage Δ
src/kernels/jupyter/finder/remoteKernelFinder.ts 88% <100%> (+7%) ⬆️
src/platform/common/cancellation.ts 62% <0%> (-6%) ⬇️
.../standalone/survey/dataScienceSurveyBanner.node.ts 66% <0%> (-6%) ⬇️
src/kernels/debuggerStartupCodeProvider.ts 100% <0%> (ø)
...c/kernels/execution/cellExecutionMessageHandler.ts 77% <0%> (+<1%) ⬆️
src/kernels/kernel.ts 82% <0%> (+<1%) ⬆️
src/notebooks/controllers/kernelRanking/helpers.ts 57% <0%> (+<1%) ⬆️
src/platform/common/utils/localize.ts 76% <0%> (+<1%) ⬆️
.../kernels/raw/launcher/kernelEnvVarsService.node.ts 78% <0%> (+<1%) ⬆️
src/kernels/kernelDependencyService.node.ts 85% <0%> (+<1%) ⬆️
... and 40 more

Copy link
Contributor

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

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

Please could you check the changes here #11692
I think that might be a better way, I didn't want to push changes to your PR
please use my PR as a suggestion.

I think its better to trigger the change event closer to where the values are updated,
the problem today is the getFromCache updates the cached property when i think that's incorrect, as it should just return as the method implies, else the method should be named initializeFromCache

The reason, I'm rejecting this PR is it feels a little hackish to call updateCache after calling getFromCache & the fact that we're relying on the side effect for the event.

Copy link
Contributor

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

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

Appoving the PR as my nit with the current approach doesn't warrant a rejection,
it's merely a code smell

@rebornix
Copy link
Member Author

@DonJayamanne thanks for reviewing the changes. I guess the naming of the functions is a bit confusing but the reason we need one more updateCache is not that we rely on its side effect, it's ensuring that if we initially loadCache successfully, making sure that we trigger a real kernel find. It's possible that we found something in the cache, and there is no relevant emitted to trigger a research, we never do the real kernel find before users run a cell. Changes #11692 here are good but they don't fix the particular bug.

@rebornix rebornix merged commit 841a4f4 into main Oct 18, 2022
@rebornix rebornix deleted the rebornix/trigger-remote-kernel-cache-update-on-start branch October 18, 2022 14:44
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.

Remote kernel list is partial on window reload
4 participants