Re: [PATCH] fix non interruptable hang in svn client when connecting
From: <kfogel_at_collab.net>
Date: 2005-08-25 18:02:18 CEST
Yun Zheng Hu <yunzheng.hu@gmail.com> writes:
Oh, I know, I reproduced it myself on Debian GNU/Linux too.
> The bug might also be related to apr_signal, but havent really tested yet.
In other words, it *becomes* interruptable *if* we set a timeout, on
I tried the patch below (same as my earlier patch, but with a
I could easily believe that Mac OS/X and Linux behave differently in
Thanks,
--
www.collab.net <> CollabNet | Distributed Development On Demand
[[[
Fix a bug whereby connecting to a non-existent repository can cause
apr_socket_connect() to hang non-interruptably. To reproduce, try
'svn co svn://svn.edgewall.com'.
Patch by: Yun Zheng Hu <yunzheng.hu@gmail.com>
(Tweaked by me to use apr_socket_set_timeout instead of apr_setsocketopt.)
* subversion/libsvn_ra_svn/client.c
(make_connection): Set socket timeout to 30 seconds.
]]]
Index: subversion/libsvn_ra_svn/client.c
===================================================================
--- subversion/libsvn_ra_svn/client.c (revision 15904)
+++ subversion/libsvn_ra_svn/client.c (working copy)
@@ -136,6 +136,22 @@
if (status)
return svn_error_wrap_apr(status, _("Can't create socket"));
+ /* Setting a timeout does more than just cause the attempt to fail
+ automatically after 30 seconds without success; it makes
+ apr_socket_connect() interruptable, which it otherwise would not
+ be, at least on Mac OS X. See this message and thread for more:
+
+ http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgNo=104587
+ From: Yun Zheng Hu <yunzheng.hu@gmail.com>
+ To: dev@subversion.tigris.org
+ Subject: [PATCH] fix non interruptable hang in svn client when connecting
+ Date: Thu, 25 Aug 2005 00:40:07 +0200
+ Message-ID: <df84014e05082415405cdd9b13@mail.gmail.com>
+ */
+ status = apr_socket_timeout_set(*sock, 30 * APR_USEC_PER_SEC);
+ if (status)
+ return svn_error_wrap_apr(status, _("Can't set timeout"));
+
status = apr_socket_connect(*sock, sa);
if (status)
return svn_error_wrap_apr(status, _("Can't connect to host '%s'"),
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 25 19:02:12 2005
|
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.