darcs

Issue 1035 get => hangs (2.0.2+126)

Title get => hangs (2.0.2+126)
Priority bug Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, kowey, techtonik, thorkilnaur
Assigned To dmitry.kurochkin
Topics HTTP

Created on 2008-08-25.19:50:01 by kowey, last changed 2009-08-27.14:18:51 by admin.

Files
File name Uploaded Type Edit Remove
darcs-curl-log-2008-08-25.tgz kowey, 2008-08-25.19:49:57 application/x-gzip
darcs-log-2008-09-03.gz kowey, 2008-09-03.21:22:02 application/x-gunzip
debug-http-tahoe.gz kowey, 2008-08-30.15:03:10 application/x-gzip
dmitry-patches-since-2.0.2 kowey, 2008-08-25.19:50:19 application/octet-stream
url_hs_-fix-race-condition-in-copyurlwithpriority-and-waiturl_.dpatch dmitry.kurochkin, 2008-09-03.20:19:41 text/x-darcs-patch
Messages
msg5692 (view) Author: kowey Date: 2008-08-25.19:49:57
More trouble with darcs get, this time on Linux X86_64 machine
                                                               
libcurl 7.18.0                                                                 
darcs 2.0.2+126
using a proxy server                                                           

Interestingly, it does not appear to hang in the same place each time.         
                                               
Maybe it's getting further along each time (I do have the global cache enabled
on this machine, if this explains anything)                            
                                               
                                                                               
                                               
I will attach a list of patches from Dmitry since 2.0.2 along with the --debug
--timings logs

[by the way, Dmitry, I've added an HTTP topic to the bugtracker; maybe you
should consider editing your details so that you are nosy on that topic]
Attachments
msg5823 (view) Author: kowey Date: 2008-08-30.15:03:10
I'm attaching the debug http output trying to do darcs get.  Note that this is a
different repository, on doing a get on a different machine.  Same darcs and
libcurl configuration though.  Doing the same get with --disable-pipelining
seems to work.
Attachments
msg5854 (view) Author: dmitry.kurochkin Date: 2008-08-31.22:23:12
Unfortunately I do not see anything interesting in the log. At the moment I
suspect a curl problem, since you say it works with --disable-pipelining.
Ideas/questions:

1. There is a proxy server. Can you try running on the same machine but without
a proxy? If it works without a proxy it is clearly a curl problem.

2. Can you upgrade to curl 7.18.2 and/or nightly?

BTW On my debian x64 'darcs get http://allmydata.org/source/tahoe/prod' runs
fine. curl 7.18.2, pipelining enabled, no proxy.

Regards,
  Dmitry
msg5855 (view) Author: kowey Date: 2008-09-01.09:00:13
I am forced to use a proxy, sadly.

But I can work on getting a recent libcurl on my machine to see.

If it turns out that having libcurl < 7.18.2 is the problem, we may have to
alter the configure scripts not to enable pipelining for these inferior versions :-(
msg5878 (view) Author: dmitry.kurochkin Date: 2008-09-01.18:15:37
Eric, today curl 7.19.0 was released with more pipelining fixes. I think it is
worth trying if 7.18.2 does not work.

Regards,
  Dmitry
msg5891 (view) Author: kowey Date: 2008-09-03.16:17:18
Upgrading to curl 7.19.0 does not appear to help, sadly.
msg5892 (view) Author: dmitry.kurochkin Date: 2008-09-03.19:34:50
After looking at your logs and code again, I think I have found one problem. I
hope this problem causes the bug.

The problem is that waitUrl reads notification MVar, deletes it from the map and
starts waiting on it. At the same time another thread can call copyUrl, which
creates a new notify MVar and puts it into the map. Next waitUrl hangs...

Will attach a patch for testing soon.

Is the bug always reproducible? On any repo?

Regards,
  Dmitry
msg5893 (view) Author: kowey Date: 2008-09-03.19:42:31
Cool!

On Wed, Sep 03, 2008 at 19:34:52 -0000, dmitry.kurochkin wrote:
> Is the bug always reproducible? On any repo?

It does seem to always hang, although I'm only testing by getting
the darcs.net repo
msg5894 (view) Author: dmitry.kurochkin Date: 2008-09-03.20:19:41
The patch is attached. Hopefully it fixes the problem...

Regards,
  Dmitry
Attachments
msg5895 (view) Author: kowey Date: 2008-09-03.21:22:02
On Wed, Sep 03, 2008 at 20:19:43 -0000, dmitry.kurochkin wrote:
> The patch is attached. Hopefully it fixes the problem...

Sadly, not :-(

Log attached
Attachments
msg5897 (view) Author: dmitry.kurochkin Date: 2008-09-04.08:28:37
Eric, in the last log I see many "Couldn't handle interrupt since darcs was in a
sensitive job.". Did you hit C-c?

Is it possible to get traffic dump?

Regards,
  Dmitry
msg5898 (view) Author: dmitry.kurochkin Date: 2008-09-04.08:34:11
Another thought, how long do you wait befor killing darcs? When connection is
lost curl can wait for timeout for quite some time... And from logs it looks
like URL thread is blocked in hscurl.c.

I will try getting through proxy with pipelining enabled and disabled. And
compare my logs with yours.

Regards,
  Dmitry
msg5899 (view) Author: kowey Date: 2008-09-04.09:21:31
On Thu, Sep 04, 2008 at 08:28:39 -0000, dmitry.kurochkin wrote:
> Eric, in the last log I see many "Couldn't handle interrupt since darcs was in a
> sensitive job.". Did you hit C-c?

Yes.

> Is it possible to get traffic dump?

I don't really know how to give you one.  Googling, I see there is a
tcpdump command, which I might try later.

Responding to your next comment

On Thu, Sep 04, 2008 at 08:34:13 -0000, dmitry.kurochkin wrote:
> Another thought, how long do you wait befor killing darcs? When connection is
> lost curl can wait for timeout for quite some time... And from logs it looks
> like URL thread is blocked in hscurl.c.

I don't remember.  I'm pretty sure I just went away, did something else,
and came back, maybe 5 or 10 minutes?

> I will try getting through proxy with pipelining enabled and disabled. And
> compare my logs with yours.

Thanks
msg5900 (view) Author: dmitry.kurochkin Date: 2008-09-04.10:28:14
On Thu, Sep 4, 2008 at 1:21 PM, Eric Kow <bugs@darcs.net> wrote:
>
> Eric Kow <kowey@darcs.net> added the comment:
>
> On Thu, Sep 04, 2008 at 08:28:39 -0000, dmitry.kurochkin wrote:
>> Eric, in the last log I see many "Couldn't handle interrupt since darcs was in a
>> sensitive job.". Did you hit C-c?
>
> Yes.

So it really hangs not at the end but before you hit C-c.

>
>> Is it possible to get traffic dump?
>
> I don't really know how to give you one.  Googling, I see there is a
> tcpdump command, which I might try later.

Try:

# tcpdump -w darcs.pcap -s 0 host darcs.net

And make sure that no other programs are talking to darcs.net.

>
> Responding to your next comment
>
> On Thu, Sep 04, 2008 at 08:34:13 -0000, dmitry.kurochkin wrote:
>> Another thought, how long do you wait befor killing darcs? When connection is
>> lost curl can wait for timeout for quite some time... And from logs it looks
>> like URL thread is blocked in hscurl.c.
>
> I don't remember.  I'm pretty sure I just went away, did something else,
> and came back, maybe 5 or 10 minutes?

Understood.

Regards,
  Dmitry
msg5902 (view) Author: dmitry.kurochkin Date: 2008-09-04.13:01:52
I was able to reproduce the bug! I have setup with transparent proxy. Running
darcs with empty http_proxy goes fine (using transparent proxy). But when I
specify http_proxy explicitly it hangs.

This is clearly curl issue. I will take a look at what is going on there, but
this can take time.

BTW I believe my race condition patch is relevant, just fixes another bug. So I
will submit it.

Regards,
  Dmitry
msg5905 (view) Author: dmitry.kurochkin Date: 2008-09-04.14:47:10
I have reproduced the bug outside of darcs and reported it to libcurl ML.

Unfortunately it looks like we will have to fix this bug by increasing minimal
curl version for pipelining to 7.19.1. Which will be released around November.

Regards,
  Dmitry
msg5931 (view) Author: kowey Date: 2008-09-07.23:32:26
I sent this message yesterday, but it never got on the bugtracker.
Resending.

On Thu, Sep 04, 2008 at 14:47:12 -0000, dmitry.kurochkin wrote:
> I have reproduced the bug outside of darcs and reported it to libcurl ML.

Great work.

> Unfortunately it looks like we will have to fix this bug by increasing minimal
> curl version for pipelining to 7.19.1. Which will be released around November.

Ok, so 2.0.3 will ship without pipelining by default, thanks!

Earlier offlist, I had suggested to Dmitry that we compile it, but turn
it off by default on runtime (--{no,}-http-pipelining).  We could
consider this as an alternative.
msg5958 (view) Author: dmitry.kurochkin Date: 2008-09-09.05:14:34
Darcs now has pipelining disabled by default for curl < 7.19.1:

Mon Sep  8 21:57:26 MSD 2008  Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
  * Add -[-no]-http-pipelining options, disable pipelining by default for curl <
7.19.1.

My fix for the curl bug has been applied upstream. You can find it in CVS or
daily snapshots starting from curl-7.19.1-20080909.

Regards,
  Dmitry
msg6324 (view) Author: techtonik Date: 2008-10-16.11:17:18
The same issue with proxy here. Are there any 2.1.0 binaries to test on windows?
msg6325 (view) Author: dmitry.kurochkin Date: 2008-10-16.11:30:17
Do you mean the issue is not resolved?

Regards,
  Dmitry
msg6326 (view) Author: techtonik Date: 2008-10-16.12:34:15
There aren't any working binaries for windows where I can say that this issue is
fixed. Until then I still can't use Darcs.
History
Date User Action Args
2008-08-25 19:50:01koweycreate
2008-08-25 19:50:21koweysetfiles: + dmitry-patches-since-2.0.2
2008-08-28 08:01:11dmitry.kurochkinsetassignedto: dmitry.kurochkin
2008-08-30 15:03:12koweysetfiles: + debug-http-tahoe.gz
status: unread -> unknown
messages: + msg5823
2008-08-31 22:23:15dmitry.kurochkinsetmessages: + msg5854
2008-09-01 09:00:15koweysetmessages: + msg5855
2008-09-01 18:15:39dmitry.kurochkinsetmessages: + msg5878
2008-09-03 16:17:20koweysetmessages: + msg5891
2008-09-03 19:34:52dmitry.kurochkinsetmessages: + msg5892
2008-09-03 19:42:33koweysetmessages: + msg5893
2008-09-03 20:19:43dmitry.kurochkinsetfiles: + url_hs_-fix-race-condition-in-copyurlwithpriority-and-waiturl_.dpatch
messages: + msg5894
2008-09-03 21:22:04koweysetfiles: + darcs-log-2008-09-03.gz
messages: + msg5895
2008-09-04 08:28:39dmitry.kurochkinsetmessages: + msg5897
2008-09-04 08:34:13dmitry.kurochkinsetmessages: + msg5898
2008-09-04 09:21:33koweysetmessages: + msg5899
2008-09-04 10:28:16dmitry.kurochkinsetmessages: + msg5900
2008-09-04 13:01:54dmitry.kurochkinsetmessages: + msg5902
2008-09-04 14:47:12dmitry.kurochkinsetmessages: + msg5905
2008-09-07 23:32:29koweysetmessages: + msg5931
2008-09-09 05:14:37dmitry.kurochkinsetstatus: unknown -> resolved-in-unstable
messages: + msg5958
2008-10-16 11:17:20techtoniksetnosy: + techtonik, simon, thorkilnaur
messages: + msg6324
2008-10-16 11:30:19dmitry.kurochkinsetnosy: kowey, dagit, simon, thorkilnaur, dmitry.kurochkin, techtonik
messages: + msg6325
2008-10-16 12:34:17techtoniksetnosy: kowey, dagit, simon, thorkilnaur, dmitry.kurochkin, techtonik
messages: + msg6326
2009-04-22 03:32:51twbsetstatus: resolved-in-unstable -> resolved
nosy: kowey, dagit, simon, thorkilnaur, dmitry.kurochkin, techtonik
2009-08-10 23:43:53adminsetnosy: - dagit
2009-08-25 17:31:13adminsetnosy: + darcs-devel, - simon
2009-08-27 14:18:51adminsetnosy: kowey, darcs-devel, thorkilnaur, dmitry.kurochkin, techtonik