On 14 May 2013, at 17:18, Daniel Stenberg <dan...@haxx.se> wrote: >> We've been getting a problem with our unit tests where FTP uploads using >> curl_multi were stalling. > > Multi or easy makes no difference internally these days!
Good point. Our layer on top (https://github.com/karelia/ConnectionKit incidentally) has an option to do things either synchronously or asynchronously, which for FTP essentially boils down to using curl_easy or curl_multi. If we use the synchronous one, we don't get the stall. But then we're not doing things in parallel in that situation, so it's not really a fair comparison. >> The test in question starts off three uploads and three downloads to the >> same server in parallel. Unless we're somehow missing an error condition >> somewhere, it looks like all the uploads hang. > > Are you using active FTP? Does the problem require these three > uploads/downloads to trigger? Do all the uploads hang at the same spot in the > transfer, and if so where exactly is that? Passive I think. I'll have to go back and verify the answers to the other questions, but I think that they are no, and yes respectively! There's a report of the stalls in some discussion here: https://github.com/karelia/ConnectionKit/commit/a3b69c2160a205312259c6b338ae305fdf8383d5#commitcomment-3210475 and in that case it seems to be: 2013-05-14 19:34:26.223 Orbitink[73606:5c1b] TYPE I 2013-05-14 19:34:26.223 Orbitink[73606:5c1b] FTP 0x10087bd10 (line 3594) state change from STOP to STOR_TYPE 2013-05-14 19:34:26.296 Orbitink[73606:5c1b] 200 Switching to Binary mode. 2013-05-14 19:34:26.296 Orbitink[73606:5c1b] STOR index.html 2013-05-14 19:34:26.296 Orbitink[73606:5c1b] FTP 0x10087bd10 (line 1701) state change from STOR_TYPE to STOR which does look like the right sort of place. However, that thread is actually contradicting my claim that reverting your commit fixed it - so it may be a red herring, or there may be other things going on. >> I seem to have tracked this down to commit 57aeabcc1a2 > > I don't understand how this waiting for an additional socket (that the commit > introduced) can cause a hang like that! Can you? I have to confess that I've not traced the code through at the libcurl level yet. I just did a kind of manual git bisect to find the point where the stall started happening, and it came down to that commit. ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html