-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
non-blocking file upload API (formdata based) #5086
Conversation
d6c3090
to
53fd418
Compare
53fd418
to
6559489
Compare
6559489
to
f696225
Compare
@akosyakov Question: When I Drag & Drop Theia into a workspace, there are many files , but I get the following error: root ERROR Error: Upload Failed: Network Failure I noticed that the UI did not freeze while transferring, The UI responded, I open a file and was able to navigate while the transfer occurred, but the Dropping files stopped at around 40%. Is there a limit for the number of files we can Drag & Drop ? |
@lmcbout No, it seems to be caused by network failure, so upload could not recover afterwards. I will try to reproduce. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works nicely! 🎉
Thanks!
f696225
to
3c6da2b
Compare
@lmcbout i was able to reproduce, unfortunately an http request is hanging after reconnection. I would try to timeout it in order to fail upload. |
3c6da2b
to
2d6be38
Compare
@lmcbout please try again, i've added a timeout of 5s which gets reset till the browser keeps sending upload progress reporting, so uploading of one big file still should be possible |
@akosyakov I tried with your latest change and when I tried to upload Theia project to a new workspace and open files from another folder in my workspace, the following error occured: root ERROR Error: Upload Failed: Network Failure |
@lmcbout it means that there are issues with an internet connection between you and the server. Where do you try? Do you have a proxy between you and the server with some limitations? Check in the chrome network tab why an upload request failed. There should be an http response from a proxy/server. You should see why it happens. I don't think it can be fixed in the code. |
@lmcbout i cannot reproduce it. What is your local machine? Could it be that it is not powerful enough to handle upload and other UI actions in parallel in the backend, so that a browser does not receive a response from a local server? |
@elaihau @vince-fugnitto Could you try as well? Upload theia and at the same time navigate through other files. I want to understand whether it is a general issue or an issue with a particular dev machine. @lmcbout can you try in Gitpod? |
from my dev machine (ubuntu 16 + chrome), i tried (a few times) drag and drop theia folder into my workspace. Colors in Chrome became dark, and then Chrome crashed. |
@elaihau Which chrome version? and if you do it Gitpod, the same? |
Version 73.0.3683.103 (Official Build) (64-bit) |
My is 74.0.3729.131 (Official Build) (64-bit). It can crash if all files are loaded in memory, like the whole theia project, but code is chunking it with each chunk of 64Mb size. It can be that some version of a browser does not implement lazy file loading properly, so then it won't be possible to upload big amount of files. I am not even sure that there is a way to prevent a browser load everything into the memory then. |
My Google version is: Version 72.0.3626.121 (Official Build) (64-bit) |
2d6be38
to
514ebc0
Compare
@lmcbout i've increased a timeout to 30s and removed all sync access to fs during upload on the backend. Could you try please whether it makes the difference? |
But in Gitpod all fine? If it is so then it won’t be a browser issue. I was able to reproduce an issue with failed connection locally with Firefox. Browser gets very busy transferring files and does not give a chance to backend to process them, so connection gets unresponsive. In practice you won’t upload to your local machine, so backend will stay responsive. It does not make much sense to test it locally. Please check that uploading files up to 60 mb is still possible as on master. Preferably in Gitpod. |
Also please use latest Chrome, yours are outdated. |
ecf2d25
to
b24ea74
Compare
1ef5064
to
61f460a
Compare
@lmcbout I've added retry 5 times on network failures for each chunk. |
WIth a local setup, I can upload a file from the workspace to the workspace. 🤦♂ I guess it runs into a loop because the
Another thing, super minor though, |
It turned out, it happens with a normal use case in both FF and Chrome. |
@akosyakov My test was to add Theia into a folder by using Drag & Drop I updated Chrome to : Version 74.0.3729.131 (Official Build) (64-bit) I also tried on Firefox, I got a different behavior and at the end it stops after a few retry. It uploaded files up to 24% until it timed out. We have many retry now, but it seems we cannot upload a project like Theia into a workspace When trying to load a 20 Meg file, Firefox and Chrome report a loop in the message from 0 to 100% and start over and over again, but never ends. See little video. |
61f460a
to
01a7087
Compare
@lmcbout sorry, i introduced some bugs today, just pushed a fix for them, please try again, also @geropl @kittaakos on FireFox the state is still pretty bad, requests are just sometimes bogus, i'm trying to understand why. Also performance of FireFox compare to Chrome is very bad at least on mac. |
I tested with the latest change on Chrome v74
|
@elaihau locally or in Gitpod? Did you try a file of 60 Mb too? |
sorry for the confusion, i tested locally |
@elaihau as i've explained local test does not make sense, see here: #5086 (comment)
I will remove download/upload commands for electron. |
ok, i tested on gitpod, and saw almost the same behaviours. only difference is the "time out" messages started to show up at 26%. |
@akosyakov
|
01a7087
to
e057e96
Compare
Signed-off-by: Anton Kosyakov <[email protected]>
e057e96
to
e507a0b
Compare
This is related but probably belongs to another task & PR: while files are being uploaded / downloaded, do we want to block users from switching from one git branch to another? |
Tested in gitpod. I had exactly the same problem that Jacques and I reported yesterday. |
I do not think so. |
I don't think so either, user can cancel it. Related to issues:
|
I tested the latest commit (e507a0b) with large files (80M and 120M) result: file transfered and able to open it, but the client stop responding for a short period (can see the bottom toolbar showing Offline) but it recovers.
|
I am going to give up on I will go with chunking and streaming over the web socket, similar to https://github.com/mozilla/send. It will have very low memory footprint on both sides and allow to upload limitless amount of data. Hope i won't need to compromise UI responsiveness and upload speed for it too much. |
It's breaking to redesign APIs. I've updated CHANGELOG with a record for it.
TODO:
often bad request- it's a Gitpod proxy issue, i don't get it locally/tmp
to/home
)