-
Notifications
You must be signed in to change notification settings - Fork 200
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
Upload on SSL - intermittent hang #283
Comments
May be related to #245 |
Does this also happen when you run it with |
It fails with |
I did some more testing. It's not related to SSL. If the local client connects to a remote Nginx reverse proxy to connect to an IPFS on the same machine as Nginx, the upload hangs. It can be over HTTP or over HTTPS; behavior is the same. If Nginx is removed from the picture, the upload succeeds each time. I tried setting I traced the local connection with WireShark and the failures all happen during It's not clear to me if this is an Nginx configuration issue, or if IPFS doesn't play nice with Nginx proxying. I doubt switching Python HTTP clients or reconfiguring the Python HTTP client will make any difference here, as the data simply did not come back from the remote HTTP server (Nginx). I did try setting SO_RCVBUF to ten megabytes just for fun (no difference). Recommendation I think the client should implement a piecemeal approach to directory uploads, instead of sending it all in one giant POST request. It's likely single-file requests would succeed where this large request is failing; it also provides a way to measure and report upload progress (see #122). |
Thank you for the detailed analysis! I do sincerely hope that your conclusion isn't correct however: Implementing piecemeal uploading (using client-side IPLD with pipelined For upload progress we could already invoke a callback after every file or file chunk, but we don't currently know the total number of files and total upload size before completing the upload, so that is of limited utility and this wouldn't really change either if we had the above. I do have one other idea however: Maybe we can get this to work by forcing the write-end of the TCP stream to be closed after the upload has been completed on our end. For this, could you try hacking in a call to |
When using
docs/publish.py
to publish to an IPFS server that is protected by SSL using Nginx as a reverse-proxy, I've noticed numerous instances of the script getting stuck waiting onFile "/usr/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
It fails more often than it succeeds. It's not clear to me if this is an issue with the underlying SSL library (seems possible but unlikely), or Nginx (possible but also unlikely), or if there are some incorrect assumptions in the IPFS client about how it interacts with the IPFS server pushing numerous files up over a slow connection.
Example traceback, after pressing Ctrl+C to cancel it after its stuck:
The text was updated successfully, but these errors were encountered: