You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by solo turn <so...@yahoo.com> on 2002/08/20 14:35:32 UTC

signal handling

svn seems not to obey signal handling correctly. if you press
"ctrl-c" it is possible to get an inconsistent working-copy state.

maybe this is the same issue we discussed earlier in writing some
change completely or not (to prevent also inconsistent states in
cases of crashes or network timeouts).



__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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

Re: signal handling

Posted by cm...@collab.net.
Justin Erenkrantz <je...@apache.org> writes:

> On Tue, Aug 20, 2002 at 01:54:58PM -0500, cmpilato@collab.net wrote:
> > Communicate back to SVN?  Huh?  I don't know much about signal
> > handlers, but I assume that there is some signal handling function
> > that is registered as such in main().  That function would just run
> > svn_client_cleanup directly.  Perhaps my ignorance is showing through
> > in a glaring way now, though...
> 
> Greg's point is that you don't want to run svn_client_cleanup when
> you don't know where the program is.  You'd only want to run
> svn_client_cleanup at specific places.  That means, "set a global
> flag, various bits of SVN code, here, there everywhere periodically
> checks that flag" - which of course, is silly.  
> 
> I'd guess arbitrarily running svn_client_cleanup is much more
> dangerous than the current behavior.  -- justin

Ah.  I see.

/me slinks back into the darkness...

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

Re: signal handling

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Tue, Aug 20, 2002 at 11:59:59AM -0700, Justin Erenkrantz wrote:
> On Tue, Aug 20, 2002 at 01:54:58PM -0500, cmpilato@collab.net wrote:
> > Communicate back to SVN?  Huh?  I don't know much about signal
> > handlers, but I assume that there is some signal handling function
> > that is registered as such in main().  That function would just run
> > svn_client_cleanup directly.  Perhaps my ignorance is showing through
> > in a glaring way now, though...
> 
> Greg's point is that you don't want to run svn_client_cleanup when
> you don't know where the program is.  You'd only want to run
> svn_client_cleanup at specific places.  That means, "set a global
> flag, various bits of SVN code, here, there everywhere periodically
> checks that flag" - which of course, is silly.  
> 
> I'd guess arbitrarily running svn_client_cleanup is much more
> dangerous than the current behavior.  -- justin

also, it's not necessarily safe to do a lot of things (including using
malloc) inside a signal handler, so if svn_client_cleanup calls any
function that is async-signal unsafe (and deep down inside apr i imagine 
it might), then we can't call it inside a signal handler anyway.

-garrett

-- 
garrett rooney                    Remember, any design flaw you're 
rooneg@electricjellyfish.net      sufficiently snide about becomes  
http://electricjellyfish.net/     a feature.       -- Dan Sugalski

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

Re: signal handling

Posted by Justin Erenkrantz <je...@apache.org>.
On Tue, Aug 20, 2002 at 01:54:58PM -0500, cmpilato@collab.net wrote:
> Communicate back to SVN?  Huh?  I don't know much about signal
> handlers, but I assume that there is some signal handling function
> that is registered as such in main().  That function would just run
> svn_client_cleanup directly.  Perhaps my ignorance is showing through
> in a glaring way now, though...

Greg's point is that you don't want to run svn_client_cleanup when
you don't know where the program is.  You'd only want to run
svn_client_cleanup at specific places.  That means, "set a global
flag, various bits of SVN code, here, there everywhere periodically
checks that flag" - which of course, is silly.  

I'd guess arbitrarily running svn_client_cleanup is much more
dangerous than the current behavior.  -- justin

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

Re: signal handling

Posted by cm...@collab.net.
Greg Stein <gs...@lyra.org> writes:

> > Jon Trowbridge <jo...@trowbridge.org> just gave an interesting
> > (non-original, he admits) suggestion regarding this.  He suggested
> > that we create a custom signal handler that does the following things:
> > 
> >    - unregisters itself as the signal handler!
> >    - prints a warning to the user "Attempting cleanup; hit Cntrl-C
> >      again to immediately abort()."
> >    - begins doing cleanup-ish things.
> > 
> > Sounds kinda nifty to me (which is *not* to say, "I plan to begin
> > implementing this now").
> 
> How does the signal handler communicate back to SVN that it should "begin
> doing cleanup-ish things"??
> 
> Are you about to say, "set a global flag. various bits of SVN code here,
> there, everywhere periodically checks that flag..." ??

Communicate back to SVN?  Huh?  I don't know much about signal
handlers, but I assume that there is some signal handling function
that is registered as such in main().  That function would just run
svn_client_cleanup directly.  Perhaps my ignorance is showing through
in a glaring way now, though...

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

Re: signal handling

Posted by Greg Stein <gs...@lyra.org>.
On Tue, Aug 20, 2002 at 09:45:51AM -0500, cmpilato@collab.net wrote:
> solo turn <so...@yahoo.com> writes:
> > svn seems not to obey signal handling correctly. if you press
> > "ctrl-c" it is possible to get an inconsistent working-copy state.
> > 
> > maybe this is the same issue we discussed earlier in writing some
> > change completely or not (to prevent also inconsistent states in
> > cases of crashes or network timeouts).
> 
> Jon Trowbridge <jo...@trowbridge.org> just gave an interesting
> (non-original, he admits) suggestion regarding this.  He suggested
> that we create a custom signal handler that does the following things:
> 
>    - unregisters itself as the signal handler!
>    - prints a warning to the user "Attempting cleanup; hit Cntrl-C
>      again to immediately abort()."
>    - begins doing cleanup-ish things.
> 
> Sounds kinda nifty to me (which is *not* to say, "I plan to begin
> implementing this now").

How does the signal handler communicate back to SVN that it should "begin
doing cleanup-ish things"??

Are you about to say, "set a global flag. various bits of SVN code here,
there, everywhere periodically checks that flag..." ??

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

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

Re: signal handling

Posted by cm...@collab.net.
solo turn <so...@yahoo.com> writes:

> svn seems not to obey signal handling correctly. if you press
> "ctrl-c" it is possible to get an inconsistent working-copy state.
> 
> maybe this is the same issue we discussed earlier in writing some
> change completely or not (to prevent also inconsistent states in
> cases of crashes or network timeouts).

Jon Trowbridge <jo...@trowbridge.org> just gave an interesting
(non-original, he admits) suggestion regarding this.  He suggested
that we create a custom signal handler that does the following things:

   - unregisters itself as the signal handler!
   - prints a warning to the user "Attempting cleanup; hit Cntrl-C
     again to immediately abort()."
   - begins doing cleanup-ish things.

Sounds kinda nifty to me (which is *not* to say, "I plan to begin
implementing this now").


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