]> granicus.if.org Git - php/commitdiff
opcache: print restart reason
authorAlexander Polyakov <apolyakov@beget.com>
Fri, 13 Jan 2017 11:55:10 +0000 (14:55 +0300)
committerJoe Watkins <krakjoe@php.net>
Fri, 13 Jan 2017 21:34:11 +0000 (21:34 +0000)
ext/opcache/ZendAccelerator.c

index 0351729b4f87c7ce34557b649c14a35f1116ead2..8e3bbade59a90bb87d7663ebfde379ff9f4298f8 100644 (file)
@@ -2921,11 +2921,18 @@ void accel_shutdown(void)
 
 void zend_accel_schedule_restart(zend_accel_restart_reason reason)
 {
+       const char *zend_accel_restart_reason_text[ACCEL_RESTART_USER + 1] = {
+               "out of memory",
+               "hash overflow",
+               "user",
+       };
+
        if (ZCSG(restart_pending)) {
                /* don't schedule twice */
                return;
        }
-       zend_accel_error(ACCEL_LOG_DEBUG, "Restart Scheduled!");
+       zend_accel_error(ACCEL_LOG_DEBUG, "Restart Scheduled! Reason: %s",
+                       zend_accel_restart_reason_text[reason]);
 
        SHM_UNPROTECT();
        ZCSG(restart_pending) = 1;