Description of problem: On httpd graceful restart httpd error log show up this: [Tue Mar 31 12:50:42 2009] [error] [client 127.1.2.3] (43)Identifier removed: apr_global_mutex_lock(rewrite_log_lock) failed [Tue Mar 31 12:50:42 2009] [error] [client 127.1.2.3] (43)Identifier removed: apr_global_mutex_unlock(rewrite_log_lock) failed Version-Release number of selected component (if applicable): Same Error show up in 2.2.11 upstream apache httpd release Steps to Reproduce: 0. Build test apache: ./configure --prefix=/tmp/httpd-2.2.11 --enable-mods-shared=most --enable-ssl --enable-proxy 1. Create directory /tmp/foo 2. Add (this) minimal server config foo-httpd.conf: --%<-- ServerRoot "/tmp/foo" DocumentRoot "/tmp/foo" PidFile /tmp/foo/httpd.pid LoadModule dir_module /tmp/httpd-2.2.11/modules/mod_dir.so LoadModule rewrite_module /tmp/httpd-2.2.11/modules/mod_rewrite.so User nobody Group nobody ErrorLog foo-error_log RewriteLog foo-rewrite.log RewriteLogLevel 1 Listen 127.1.2.3:8765 <VirtualHost 127.1.2.3:8765> ServerName foo.bar RewriteEngine On RewriteOptions Inherit </VirtualHost> --%<-- 3. Start server: /tmp/httpd-2.2.11/bin/httpd -f /tmp/foo/foo-httpd.conf -k start 4. Do graceful restart: /tmp/httpd-2.2.11/bin/httpd -f /tmp/foo/foo-httpd.conf -k graceful 5. Find the apr_global_mutex_lock errors in /tmp/foo/foo-error_log Additional info: The error messages vanish if the RewriteLogLevel is set to 0 or the RewriteOptions Inherit ist _not_ set Kind Regards, Roland
I think I've figured out what's going on (with some help from Greg Ames). Not sure yet how to fix it. The global mutex used by mod_rewrite to serialize writing to the rewrite log is created in post_config(). So when the parent starts its graceful restart and cleans up the old configuration, it's going to clean up - destroy - that global mutex. Children still finishing up requests now have a reference to a mutex that no longer exists, hence attempts to lock the mutex fail. I think the worst effect of this is the possibility that a few rewritelog messages get intermingled in the log, which isn't too important. Still, it would be nice to figure out a way to make this work right. Maybe somebody who knows how modules work better than I knows how to do this.
Ah, this was reported directly to us too - I took a look, and I can't see what the point of the logging serialisation is at all: http://marc.info/?l=apache-httpd-dev&m=124282193217344&w=2
Created attachment 23792 [details] Remove global mod_rewrite log lock I like it! The Gordian knot solution. Here's a patch against trunk to remove the lock.
Fixed in trunk as r783734.
2.2.12 / r792910