[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: problem revealed by issue #2398 (server-side assertion)

From: Stuart Celarier <SCelarier_at_corillian.com>
Date: 2006-02-14 02:07:10 CET

Garrett wrote:
>Why change from an assert to a SVN_ERR? The assert was wrong because
>of the pointer comparison, not because of what it's testing, it's
>still fundamentally misusing the API to pass two different filesystems
>to this function, so why not make it an assert?

Yes, the pointer comparison was wrong, but aborting the server because
of a recoverable error condition is also wrong. Recovery, in this case,
would mean letting the calling operation can fail gracefully.

With all due respect, what value is provided by aborting the server? I
don't see that restarting the server after it has aborted corrects the
situation. So why abort in the first place? How is that better than
failing the operation?

On the negative side, aborting the server means that all repositories on
the server become unavailable which is not desirable behavior for a
server. Why bring the server down for all users because of a single
misuse of an API function?

Abort a server is an extremely draconian measure, it is not a general
purpose error handling strategy, and especially not on a server. "I'm
sorry, Johnny, you're late for bed so now I am going to have to shoot
you." Abort should be reserved for situations when there is *absolutely*
no other choice. That is clearly not the case here.

Returning an error value allows the calling function to analyze the
conditions that created the error, log the error with useful diagnostic
information (such as a stack trace), pass the error up for higher level
actions, or perform additional error recovery and retry the operation
successfully. Aborting via assert writes a terse message in the Apache
error log and doesn't leave much else to go on. That doesn't appear to
help the users, the administrators, or the developers.

Best regards,
Stuart

Stuart Celarier | Corillian Corporation

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Feb 14 02:07:37 2006

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.