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

Await pending directory change in filebrowser model. #5224

Merged
merged 2 commits into from Aug 29, 2018

Conversation

ian-r-rose
Copy link
Member

Possible fix for #4009.

@ian-r-rose
Copy link
Member Author

@timkpaine For posterity, can you comment on whether this fixes the issue?

I am not completely convinced that there is no way to generate a race condition after this fix, since there is some subtle logic involving scheduling auto-refreshes of the file browser model (which are not awaited). However, I think this should at least address one class of race condition.

@timkpaine
Copy link
Member

@ian-r-rose sure, this seems to fix the particular issue of when you specify a default_url pointing to something like /lab/tree/path/to/dir, where that dir has <<< # of files of the top level dir. Previously, the initial listing of the top level dir came back after the subdirectories, and clobbered the file browser (while leaving the launcher pointing to the subdir).

@timkpaine
Copy link
Member

@ian-r-rose this should also resolve the race condition of cd ing between directories quicker than they can be fetched and ending up in the wrong one. (though as you said, this may also have bad interplay with the auto refresh cds).

@ian-r-rose
Copy link
Member Author

I think cding into multiple directories should work okay, since those should be properly awaited or handled in a Promise resolver. I believe the problem here is in the initial refresh() called upon construction of the file browser model, which is not awaited.

I'm trying to construct a test that will catch this, but it's fiddly stuff.

@blink1073
Copy link
Member

(a)waiting for Godot...

@ian-r-rose
Copy link
Member Author

Okay, this now has a kind-of-confusing test for the race condition.

@blink1073 blink1073 added this to the 0.35 milestone Aug 29, 2018
@blink1073
Copy link
Member

Thanks!

@blink1073 blink1073 merged commit 3489763 into jupyterlab:master Aug 29, 2018
@blink1073
Copy link
Member

@meeseeksdev, backport to 0.34.x

@blink1073 blink1073 mentioned this pull request Aug 29, 2018
blink1073 pushed a commit that referenced this pull request Aug 29, 2018
* Await pending directory change in filebrowser model.

* Add test for slow initial fetch of filebrowser model.
@blink1073 blink1073 modified the milestones: 0.35, 1.0 Sep 5, 2018
@blink1073 blink1073 modified the milestones: 1.0, 0.35 Sep 28, 2018
@blink1073 blink1073 mentioned this pull request Sep 28, 2018
31 tasks
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Aug 8, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg:filebrowser status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants