Date: Tue, 15 Dec 2009 00:45:46 +0100 From: =?ISO-8859-1?Q?Bernhard_Wei=DFhuhn?= <bkw@weisshuhn.de> To: apache@FreeBSD.org Subject: FreeBSD Port: www/apache20 Message-ID: <E767C5DD-FC4A-462E-BE17-533A9CE39BFE@weisshuhn.de>
next in thread | raw e-mail | index | archive | help
--Apple-Mail-2372--940695039 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi, this my first submission to bsd ports, so please be gentle if I do not follow the right procedure, and don't hesitate to point me towards the proper way to do propose patches. Attached You'll find a packport from the apache trunk that removes the locking of the RewriteLog file. Original commit (including a link explaining the rationale behind this): http://svn.apache.org/viewvc?view=revision&revision=783734 This behaviour can be a problem under heavy load, as we just witnessed. Maybe you want to include this in your port. kind regards, bkw --Apple-Mail-2372--940695039 Content-Disposition: attachment; filename="patch-modules:rewrite:mod_rewrite.c" Content-Type: application/octet-stream; x-unix-mode=0644; name="patch-modules:rewrite:mod_rewrite.c" Content-Transfer-Encoding: 7bit --- modules/mappers/mod_rewrite.c.orig 2009-12-14 23:31:04.000000000 +0100 +++ modules/mappers/mod_rewrite.c 2009-12-14 23:49:59.000000000 +0100 @@ -142,7 +142,6 @@ static const char *lockname; static apr_global_mutex_t *rewrite_mapr_lock_acquire = NULL; -static apr_global_mutex_t *rewrite_log_lock = NULL; /* Optional functions imported from mod_ssl when loaded: */ static APR_OPTIONAL_FN_TYPE(ssl_var_lookup) *rewrite_ssl_lookup = NULL; @@ -990,24 +989,6 @@ /* check if proxy module is available */ proxy_available = (ap_find_linked_module("mod_proxy.c") != NULL); - /* create the rewriting lockfiles in the parent */ - if ((rv = apr_global_mutex_create(&rewrite_log_lock, NULL, - APR_LOCK_DEFAULT, p)) != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, - "mod_rewrite: could not create rewrite_log_lock"); - return HTTP_INTERNAL_SERVER_ERROR; - } - -#ifdef MOD_REWRITE_SET_MUTEX_PERMS - rv = unixd_set_global_mutex_perms(rewrite_log_lock); - if (rv != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, - "mod_rewrite: Could not set permissions on " - "rewrite_log_lock; check User and Group directives"); - return HTTP_INTERNAL_SERVER_ERROR; - } -#endif - rv = rewritelock_create(s, p); if (rv != APR_SUCCESS) { return HTTP_INTERNAL_SERVER_ERROR; @@ -1060,12 +1041,6 @@ } } - rv = apr_global_mutex_child_init(&rewrite_log_lock, NULL, p); - if (rv != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, - "mod_rewrite: could not init rewrite log lock in child"); - } - /* create the lookup cache */ cachep = init_cache(p); } @@ -3499,7 +3474,6 @@ request_rec *req; char *ruser; const char *rhost; - apr_status_t rv; va_start(ap, text); conf = ap_get_module_config(r->server->module_config, &rewrite_module); @@ -3564,20 +3538,8 @@ (unsigned long)(r->server), (unsigned long)r, type, redir, level, str2); - rv = apr_global_mutex_lock(rewrite_log_lock); - if (rv != APR_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, - "apr_global_mutex_lock(rewrite_log_lock) failed"); - /* XXX: Maybe this should be fatal? */ - } nbytes = strlen(str3); apr_file_write(conf->rewritelogfp, str3, &nbytes); - rv = apr_global_mutex_unlock(rewrite_log_lock); - if (rv != APR_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, - "apr_global_mutex_unlock(rewrite_log_lock) failed"); - /* XXX: Maybe this should be fatal? */ - } va_end(ap); return; --Apple-Mail-2372--940695039 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit --Apple-Mail-2372--940695039--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E767C5DD-FC4A-462E-BE17-533A9CE39BFE>