Skip to content

Resolve #7889 to avoid redundant checkpoint calls on loading notebook#7926

Merged
blink1073 merged 1 commit into
jupyterlab:masterfrom
ikiw:checkpoint-calls
Mar 7, 2020
Merged

Resolve #7889 to avoid redundant checkpoint calls on loading notebook#7926
blink1073 merged 1 commit into
jupyterlab:masterfrom
ikiw:checkpoint-calls

Conversation

@ikiw

@ikiw ikiw commented Feb 25, 2020

Copy link
Copy Markdown
Contributor

Resolve #7889 to avoid 3 fetch calls to load a notebook.

References

#7889

Code changes

listCheckpoints() gets invoked thrice when a notebook is loaded resulting in 3 checkpoint calls. The code change is to have an object- checkpointPromiseQueue that holds the promises with locaPath as key. If there is already a promise to be resolved, the pending promise object is returned back instead of creating one. And the promise reference to be cleared off from the checkpointPromiseQueue, when the promise if resolved/rejected via finally block. And as a result only 1 fetch call to checkpoint is triggered.

User-facing changes

Backwards-incompatible changes

NO

Before Fix
Screenshot 2020-02-17 at 4 58 35 PM

After Fix
Screenshot 2020-02-25 at 11 22 45 PM

@jupyterlab-dev-mode

Copy link
Copy Markdown

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

@ikiw ikiw changed the title Resolve #7889 to fetch only 1 checkpoint call per notebook Resolve #7889 to avoid redundant checkpoint calls on loading notebook Feb 25, 2020

@blink1073 blink1073 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@blink1073 blink1073 merged commit aa3f0a0 into jupyterlab:master Mar 7, 2020
@saulshanabrook saulshanabrook added this to the 2.0.2 milestone Mar 30, 2020
@lock lock Bot added the status:resolved-locked Closed inactive issues are locked after a while. Please open a new issue for related discussion. label May 6, 2020
@lock lock Bot locked as resolved and limited conversation to collaborators May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

pkg:services status:resolved-locked Closed inactive issues are locked after a while. Please open a new issue for related discussion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 checkpoint get requests invoked to load a single notebook

3 participants