You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Hudson <gh...@MIT.EDU> on 2004/01/09 02:16:54 UTC

Re: svn commit: r8204 - branches/1.0-stabilization

On Thu, 2004-01-08 at 21:01, gstein@tigris.org wrote:
> +   * Issue #1693
> +     Improved signal handling for svnadmin, svnlook and svn
> +     Justification: Avoids uncontrolled termination resulting in
> +        wedged repositories. API change. Low risk.
> +     Votes:
> +      +1: bliss, rooneg, ghudson
> +      -1: gstein
> +          -- seems like a SIGPIPE should cause a graceful exit, rather
> +             than to have it continue chewing CPU.

We ignore SIGPIPE in clients/cmdline/main.c as well.  An actual output
error will result in an EPIPE, leading to an I/O error, leading to a
graceful exit.

Ignoring SIGPIPE is just something you do in order to write a robust
Unix program.


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

Re: svn commit: r8204 - branches/1.0-stabilization

Posted by Greg Stein <gs...@lyra.org>.
On Thu, Jan 08, 2004 at 09:16:54PM -0500, Greg Hudson wrote:
> On Thu, 2004-01-08 at 21:01, gstein@tigris.org wrote:
> > +   * Issue #1693
> > +     Improved signal handling for svnadmin, svnlook and svn
> > +     Justification: Avoids uncontrolled termination resulting in
> > +        wedged repositories. API change. Low risk.
> > +     Votes:
> > +      +1: bliss, rooneg, ghudson
> > +      -1: gstein
> > +          -- seems like a SIGPIPE should cause a graceful exit, rather
> > +             than to have it continue chewing CPU.
> 
> We ignore SIGPIPE in clients/cmdline/main.c as well.  An actual output
> error will result in an EPIPE, leading to an I/O error, leading to a
> graceful exit.

Ah. Gotcha. Ignore the signal so that you can "get to" the error, which
you can then handle gracefully.

Thanks. Makes a lot of sense.

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: svn commit: r8204 - branches/1.0-stabilization

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On Jan 8, 2004, at 9:16 PM, Greg Hudson wrote:

> On Thu, 2004-01-08 at 21:01, gstein@tigris.org wrote:
>> +   * Issue #1693
>> +     Improved signal handling for svnadmin, svnlook and svn
>> +     Justification: Avoids uncontrolled termination resulting in
>> +        wedged repositories. API change. Low risk.
>> +     Votes:
>> +      +1: bliss, rooneg, ghudson
>> +      -1: gstein
>> +          -- seems like a SIGPIPE should cause a graceful exit, 
>> rather
>> +             than to have it continue chewing CPU.
>
> We ignore SIGPIPE in clients/cmdline/main.c as well.  An actual output
> error will result in an EPIPE, leading to an I/O error, leading to a
> graceful exit.
>
> Ignoring SIGPIPE is just something you do in order to write a robust
> Unix program.

I've also always handled SIGPIPE by ignoring it.

-garrett


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

Re: svn commit: r8204 - branches/1.0-stabilization

Posted by Tobias Ringstrom <to...@ringstrom.mine.nu>.
Greg Hudson wrote:
> On Thu, 2004-01-08 at 21:01, gstein@tigris.org wrote:
> 
>>+   * Issue #1693
>>+     Improved signal handling for svnadmin, svnlook and svn
>>+     Justification: Avoids uncontrolled termination resulting in
>>+        wedged repositories. API change. Low risk.
>>+     Votes:
>>+      +1: bliss, rooneg, ghudson
>>+      -1: gstein
>>+          -- seems like a SIGPIPE should cause a graceful exit, rather
>>+             than to have it continue chewing CPU.
> 
> We ignore SIGPIPE in clients/cmdline/main.c as well.  An actual output

Hmm... That change is in this patch. I think you meant svnserve.

> error will result in an EPIPE, leading to an I/O error, leading to a
> graceful exit.

Exactly. The Subversion code checks the status of all write commands. 
Since SIGPIPE can only occur when writing to a file descriptor, we 
cannot handle the error any faster by installing a signal handler.

The write error also gives us a better error message. Please let me 
demonstrate how it works with the patch installed:

 > svnlook cat repos trunk/INSTALL | head -5

                ======================================
                   INSTALLING AND USING SUBVERSION
                       A Guide for Newcomers
                ======================================
svn: Can't write to stream: Broken pipe

Many unix utilities suppress the output of the broken pipe error 
message. We can do that too later if we want to of course.

/Tobias


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