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

Re: Handling assertions and malfunctions in mod_dav_svn

From: Ben Reser <ben_at_reser.org>
Date: Tue, 17 Feb 2015 10:20:03 -0800

On 2/17/15 9:44 AM, Evgeny Kotkov wrote:
> I was thinking that the runtime option could be useful, because the desired
> behavior might depend on the MPM being used. With non-threaded pre-forking
> servers, problems with a single request wouldn't affect other requests [1].
> Threaded servers, however, are those that could benefit from this kind of
> option. MPMs can be built as DSO modules and dynamically loaded into
> the server, hence adjusting the compile-time directive accordingly could
> be painful.

You're right but... It's only useful if there's some advantage to aborting.
I'd rather fix things so it isn't important to do that. If we do things right
there's almost zero reason to use the knob.

> - We solve the "A) Logging" part of the problem right now in trunk. The patch
> is quite trivial and doesn't change the existing abortive behavior. So, we
> would be basically doing the same as in Subversion 1.8, but with appropriate
> logging.
>
> I am thinking about doing this:
> [[[
> Index: subversion/mod_dav_svn/mod_dav_svn.c
> ===================================================================
> --- subversion/mod_dav_svn/mod_dav_svn.c (revision 1660432)
> +++ subversion/mod_dav_svn/mod_dav_svn.c (working copy)
> @@ -143,6 +143,25 @@ init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *
> return OK;
> }
>
> +static svn_error_t *
> +malfunction_handler(svn_boolean_t can_return,
> + const char *file, int line,
> + const char *expr)
> +{
> + if (expr)
> + ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL,
> + "mod_dav_svn: file '%s', line %d, assertion \"%s\" failed",
> + file, line, expr);
> + else
> + ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL,
> + "mod_dav_svn: file '%s', line %d, internal malfunction",
> + file, line);
> + abort();
> +
> + /* Should not be reached. */
> + return SVN_NO_ERROR;
> +}
> +
> static int
> init_dso(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
> {
> @@ -162,6 +181,8 @@ init_dso(apr_pool_t *pconf, apr_pool_t *plog, apr_
> return HTTP_INTERNAL_SERVER_ERROR;
> }
>
> + svn_error_set_malfunction_handler(malfunction_handler);
> +
> return OK;
> }
> ]]]

+1 except for the mod_dav_svn: prefix in the log output. httpd should be
adding that for you with APLOG_MARK.
Received on 2015-02-17 19:20:24 CET

This is an archived mail posted to the Subversion Dev mailing list.