From d79b82d8ae52e52e4cb30366fd4a9393597a9ab0 Mon Sep 17 00:00:00 2001 From: Alexander Polyakov Date: Fri, 13 Jan 2017 14:55:10 +0300 Subject: [PATCH] opcache: print restart reason --- ext/opcache/ZendAccelerator.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index ca57cdd8b1..d47953aed8 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -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(); -- 2.40.0