You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Malcolm Rowe <ma...@farside.org.uk> on 2007/03/07 19:11:07 UTC

SIGINT handling

On Wed, Mar 07, 2007 at 01:43:46PM -0500, David Glasser wrote:
> thing I noticed was that it seems to not want to be canceled; it seems
> to ignore SIGINTS, and I had to kill -9 it to cancel it.  I assume

This is a fairly common user report, incidentally.  While we're better
about cancellation than we used to be, I'm curious as to why we don't
just make two Ctrl-C's in a row kill the process.

i.e. change the signal handler for our command-line tools from e.g.

static void
signal_handler(int signum)
{
  apr_signal(signum, SIG_IGN);
  cancelled = TRUE;
}

to

static void
signal_handler(int signum)
{
  if (!cancelled)
    apr_signal(signum, SIG_IGN);
  cancelled = TRUE;
}


Any reason this isn't a sensible idea?  It seems really simple.

Regards,
Malcolm

Re: SIGINT handling

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Wed, Mar 07, 2007 at 02:36:32PM -0500, C. Michael Pilato wrote:
> > Any reason this isn't a sensible idea?  It seems really simple.
> 
> -1.
> 
> My concern is that people, impatient and trigger-fingered as they are,  in
> concert with the fact that our cancellation isn't an immediate event but
> instead just a scheduled stop-at-the-next-safe-stopping-point, would be
> killing their processes all the time.
> 

That makes sense, sure.

> Maybe I'd be not so opposed if the handler printed a message saying what was
> going on and intentionally ignored second-time cancellations that occurred
> within some period of time of the first.
> 
> $ svn checkout ...
> ^C
> svn:  Subversion operation will be canceled at the next safe opportunity.
> svn:  Cancel again after 5 seconds to terminate the process unceremoniously.
> ^C
> Killed.
> $
> 

Right.  Perhaps I'll take a look at what it would take to do that.  (But
if anyone else wants to take a look first, be my guest :-)).

Regards,
Malcolm

Re: SIGINT handling

Posted by "C. Michael Pilato" <cm...@collab.net>.
Malcolm Rowe wrote:
> On Wed, Mar 07, 2007 at 01:43:46PM -0500, David Glasser wrote:
>> thing I noticed was that it seems to not want to be canceled; it seems
>> to ignore SIGINTS, and I had to kill -9 it to cancel it.  I assume
> 
> This is a fairly common user report, incidentally.  While we're better
> about cancellation than we used to be, I'm curious as to why we don't
> just make two Ctrl-C's in a row kill the process.
> 
> i.e. change the signal handler for our command-line tools from e.g.
> 
> static void
> signal_handler(int signum)
> {
>   apr_signal(signum, SIG_IGN);
>   cancelled = TRUE;
> }
> 
> to
> 
> static void
> signal_handler(int signum)
> {
>   if (!cancelled)
>     apr_signal(signum, SIG_IGN);
>   cancelled = TRUE;
> }
> 
> 
> Any reason this isn't a sensible idea?  It seems really simple.

-1.

My concern is that people, impatient and trigger-fingered as they are,  in
concert with the fact that our cancellation isn't an immediate event but
instead just a scheduled stop-at-the-next-safe-stopping-point, would be
killing their processes all the time.

Maybe I'd be not so opposed if the handler printed a message saying what was
going on and intentionally ignored second-time cancellations that occurred
within some period of time of the first.

$ svn checkout ...
^C
svn:  Subversion operation will be canceled at the next safe opportunity.
svn:  Cancel again after 5 seconds to terminate the process unceremoniously.
^C
Killed.
$

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: SIGINT handling

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Wed, Mar 07, 2007 at 08:48:31PM +0100, Erik Huelsmann wrote:
> Yes, we're better, but, that code isn't anywhere in production afaik,
> so, users are still complaining about our old behaviour... I'd like to
> see the new cancellation code go in production before doing anything
> remotely like this.
> 

Oh, I didn't realise we'd done something specific for cancellation in the
1.5 timeframe, okay.

Regards,
Malcolm

Re: SIGINT handling

Posted by Erik Huelsmann <eh...@gmail.com>.
On 3/7/07, Malcolm Rowe <ma...@farside.org.uk> wrote:
> On Wed, Mar 07, 2007 at 01:43:46PM -0500, David Glasser wrote:
> > thing I noticed was that it seems to not want to be canceled; it seems
> > to ignore SIGINTS, and I had to kill -9 it to cancel it.  I assume
>
> This is a fairly common user report, incidentally.  While we're better
> about cancellation than we used to be, I'm curious as to why we don't
> just make two Ctrl-C's in a row kill the process.

Yes, we're better, but, that code isn't anywhere in production afaik,
so, users are still complaining about our old behaviour... I'd like to
see the new cancellation code go in production before doing anything
remotely like this.

Bye,

Erik.

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