ipfs-shipyard/py-ipfs-http-client

client.add() stuck

zinootje opened this issue · 5 comments

i have a directory Data which looks like this:
Data/
├─ subfolder/
│ ├─ B.html x 5000
├─ A.html
with A about 4 mb and 5000 files B each 4kb large.

when i add it with the command line (ipfs add .\Data\ -r) it takes about 10 seconds to add.
when i try to add it with you libary (client.add("Data",recursive=True)) it is still running after 5 minutes.
running go-ipfs v0.7.0 localy on a windows host
if you need more information let me know

i think i found the cause , because go-ipfs sends the hash result immediately but the python http.client doesn't read the socket until all data is send it get stuck with a tcpzerowindow. This is only o probleme with a lot of files presumably because only then ipfs-go sends more data than the socket buffer

Thank you! However, I do not believe this will be solvable using the current requests backend without resorting to bad hacks.

Will reconsider this once the new HTTPx backend is finally released.

Your right i solved for now with some bad hacks , monky patching the request libary to read the socket every time after sending a chunk. Should a bug be filled for this with requests ?

Your right i solved for now with some bad hacks , monky patching the request libary to read the socket every time after sending a chunk. Should a bug be filled for this with requests ?

@zinootje,

Do you still have your monkey patch? Would you be able to share it here?

Sorry for the late reply, do you still need it ? If so i can try to dig it up.