]> 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:33:58 +0000 (21:33 +0000)
ext/opcache/ZendAccelerator.c

index ca57cdd8b18ee898dbd7aa719766df187ae5dd23..d47953aed8264d0067dc14e90068f6049dd6780a 100644 (file)
@@ -2941,11 +2941,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]);
 
        HANDLE_BLOCK_INTERRUPTIONS();
        SHM_UNPROTECT();