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

GETs remote file twice #264

Open
yarikoptic opened this issue Aug 5, 2021 · 2 comments
Open

GETs remote file twice #264

yarikoptic opened this issue Aug 5, 2021 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers PRIORITY: High

Comments

@yarikoptic
Copy link

visiting http://nwbexplorer.opensourcebrain.org/nwbfile=https://datasets-dev.datalad.org/dandi/dandisets/000027/sub-RAT123/sub-RAT123.nwb and looking at apache logs, shows

XXX - - [05/Aug/2021:17:05:10 -0400] "GET /dandi/dandisets/000027/sub-RAT123/sub-RAT123.nwb HTTP/1.1" 200 18792
XXX - - [05/Aug/2021:17:05:18 -0400] "GET /dandi/dandisets/000027/sub-RAT123/sub-RAT123.nwb HTTP/1.1" 200 18792

with I guess first one to display details, and then 2nd one appears shortly after a spinner in Python tab stops spinning so - for that Python session? ... For a more sizeable http://nwbexplorer.opensourcebrain.org/nwbfile=https://datasets-dev.datalad.org/dandi/dandisets/000005/sub-anm184389/sub-anm184389_ses-20130207_behavior+ecephys.nwb - the same effect of two full 286MB download requests.

XXX - - [05/Aug/2021:17:10:55 -0400] "GET /dandi/dandisets/000005/sub-anm184389/sub-anm184389_ses-20130207_behavior+ecephys.nwb HTTP/1.1" 200 299000608
XXX - - [05/Aug/2021:17:11:28 -0400] "GET /dandi/dandisets/000005/sub-anm184389/sub-anm184389_ses-20130207_behavior+ecephys.nwb HTTP/1.1" 200 299000608

It seems that ideally it should be avoided, and a singular GET should be sufficient.

@filippomc filippomc added enhancement New feature or request good first issue Good for newcomers labels Aug 9, 2021
@filippomc
Copy link
Collaborator

Hi @yarikoptic thanks for the detailed analysis. Yes this is certainly related to the python console file loading.

A strategy can be to make a local copy of the downloaded file and use that copy for the Python console.
Need to ensure that the Python console load starts after the dowload is complete

@filippomc
Copy link
Collaborator

Relevant code parts:

Handle action file loading action from the frontend :

nwbFileService.loadNWBFileInNotebook(store.getState().nwbfile.nwbFileUrl).then(

Trigger notebook load action:

store.dispatch(loadNWBFileInNotebook);

The trigger must be changed, here we are not sure that the download was complete.

Backend entry point:

geppetto.set_nwb_file(nwbfilename)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers PRIORITY: High
Projects
None yet
Development

No branches or pull requests

3 participants