]> granicus.if.org Git - php/commitdiff
Make killing a locker an ERROR event
authornathan r. hruby <nhruby@gmail.com>
Tue, 3 Mar 2015 15:16:45 +0000 (23:16 +0800)
committerXinchen Hui <laruence@php.net>
Tue, 3 Mar 2015 15:16:45 +0000 (23:16 +0800)
At least in apache, killing a locker with SIGKILL from inside opcache prevents
the child process from emitting a corresponding log event to the access or
error logs, therefore requests are termed with no record.  This makes is
incredibly difficult to debug problems espically on systems with high counts
of cache restarts.  Since INFO level is far too noisy for production use,
switch the killing to a higher level so we can see it easier.

ext/opcache/ZendAccelerator.c

index d0765b9bccbb3f8fece4b92903912ecddc82697e..547814cd2e660f4f52ffeb432ef711ee4a34e7ce 100644 (file)
@@ -573,7 +573,7 @@ static inline void kill_all_lockers(struct flock *mem_usage_check)
        ZCSG(force_restart_time) = 0;
        while (mem_usage_check->l_pid > 0) {
                while (tries--) {
-                       zend_accel_error(ACCEL_LOG_INFO, "Killed locker %d", mem_usage_check->l_pid);
+                       zend_accel_error(ACCEL_LOG_ERROR, "Killed locker %d", mem_usage_check->l_pid);
                        if (kill(mem_usage_check->l_pid, SIGKILL)) {
                                break;
                        }
@@ -586,7 +586,7 @@ static inline void kill_all_lockers(struct flock *mem_usage_check)
                        usleep(10000);
                }
                if (!tries) {
-                       zend_accel_error(ACCEL_LOG_INFO, "Can't kill %d after 20 tries!", mem_usage_check->l_pid);
+                       zend_accel_error(ACCEL_LOG_ERROR, "Can't kill %d after 20 tries!", mem_usage_check->l_pid);
                        ZCSG(force_restart_time) = time(NULL); /* restore forced restart request */
                }