You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Philip Martin <ph...@codematters.co.uk> on 2005/01/15 00:30:30 UTC

[PATCH] Detect EOF during propmt

David Wilson <dw...@botanicus.net> writes:

>         $ svn co https://china.botanicus.net/svn/cdr_mysql < /dev/null

If you are running svn from a crontab then using --non-interactive
will cause it to fail rather than spin.

Does anybody understand why EOF is ignored?  Even if it's some magic
Window's stuff, I don't think it's sensible to use c after EOF.  How
about this:

Index: subversion/clients/cmdline/prompt.c
===================================================================
--- subversion/clients/cmdline/prompt.c	(revision 12736)
+++ subversion/clients/cmdline/prompt.c	(working copy)
@@ -112,7 +112,7 @@
             return svn_error_wrap_apr (status, _("Can't read stdin"));
              
           status = apr_file_getc (&c, fp);
-          if (status && ! APR_STATUS_IS_EOF(status))
+          if (status)
             return svn_error_wrap_apr (status, _("Can't read stdin"));
 
           if (saw_first_half_of_eol)


-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect EOF during propmt

Posted by Julian Foad <ju...@btopenworld.com>.
Julian Foad wrote:
> Sorry, Philip - not enough words for someone like me to understand.  
> (Apologies if it is obvious from some previous message that I haven't 
> read.)  [...]

I've now found a previous thread that gives the background: "[BUG] Resource 
consumption problem in clients/cmdline/prompt.c::prompt()." started by David 
Wilson yesterday.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect EOF during propmt

Posted by Philip Martin <ph...@codematters.co.uk>.
"C. Michael Pilato" <cm...@collab.net> writes:

> Julian Foad <ju...@btopenworld.com> writes:
>
>> Philip Martin wrote:
>> > David Wilson <dw...@botanicus.net> writes:
>> >
>> >>        $ svn co https://china.botanicus.net/svn/cdr_mysql < /dev/null
>> > If you are running svn from a crontab then using --non-interactive
>> > will cause it to fail rather than spin.
>> 
> The --non-interactive options tells Subversion to never prompt for
> auth information.  In this case, if Subversion doesn't prompt, it
> doesn't hang.

The original bug does not involve hanging, rather, the client is
running flat-out using CPU to continually ignore eof and allocate
memory.  If the client process isn't killed it will probably bring the
box running it to a grinding halt.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect EOF during propmt

Posted by "C. Michael Pilato" <cm...@collab.net>.
Julian Foad <ju...@btopenworld.com> writes:

> Philip Martin wrote:
> > David Wilson <dw...@botanicus.net> writes:
> >
> >>        $ svn co https://china.botanicus.net/svn/cdr_mysql < /dev/null
> > If you are running svn from a crontab then using --non-interactive
> > will cause it to fail rather than spin.
> 
> Sorry, Philip - not enough words for someone like me to understand.
> (Apologies if it is obvious from some previous message that I haven't
> read.)  Probably someone who is familiar with the problem will
> understand and reply.  If not, what's the behaviour seen by David
> Wilson, what is the desired behaviour, what sort of failure, what
> spins for what?

The problem seen is that Subversion needs auth info to perform the
checkout, so by default, it prompts for that information.  The problem
is that, while running from a cron job, there's no way to actually
respond to those prompts, so Subversion just hangs waiting for input
it will never get.

The --non-interactive options tells Subversion to never prompt for
auth information.  In this case, if Subversion doesn't prompt, it
doesn't hang.  But then, it doesn't get the auth info it needs either,
so it will simply return an error.  But at least it doesn't hang!

Of course, if the repository requires only simple username/password
auth input, then the cron job can use --non-interactive, --username,
and --password to achieve success.  More complex scenarios might
involve tweaking runtime config options (for the likes of cert path
and passphrase info, etc).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Detect EOF during propmt

Posted by Julian Foad <ju...@btopenworld.com>.
Philip Martin wrote:
> David Wilson <dw...@botanicus.net> writes:
> 
>>        $ svn co https://china.botanicus.net/svn/cdr_mysql < /dev/null
> 
> If you are running svn from a crontab then using --non-interactive
> will cause it to fail rather than spin.

Sorry, Philip - not enough words for someone like me to understand.  (Apologies 
if it is obvious from some previous message that I haven't read.)  Probably 
someone who is familiar with the problem will understand and reply.  If not, 
what's the behaviour seen by David Wilson, what is the desired behaviour, what 
sort of failure, what spins for what?

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org