From 2a3783cd2c2baeb42668c38f534f3fb6c1135eb9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 8 Apr 2015 11:31:19 -0700 Subject: [PATCH] Suggest "apc.slam_defense" off and "apc.write_lock" on Summary: Ref T5501. These settings reduce error log noise. Test Plan: Faked into this branch and hit the warning. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T5501 Differential Revision: https://secure.phabricator.com/D12319 --- .../cache/spec/PhabricatorOpcodeCacheSpec.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php b/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php index 0c15e6e0e0..dd270fa2a0 100644 --- a/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php +++ b/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php @@ -31,6 +31,29 @@ final class PhabricatorOpcodeCacheSpec extends PhabricatorCacheSpec { $info = apc_cache_info(); $this->setUsedMemory($info['mem_size']); + $write_lock = ini_get('apc.write_lock'); + $slam_defense = ini_get('apc.slam_defense'); + + if (!$write_lock || $slam_defense) { + $summary = pht( + 'Adjust APC settings to quiet unnecessary errors.'); + + $message = pht( + 'Some versions of APC may emit unnecessary errors into the '. + 'error log under the current APC settings. To resolve this, '. + 'enable "apc.write_lock" and disable "apc.slam_defense" in '. + 'your PHP configuration.'); + + $this + ->newIssue('extension.apc.write-lock') + ->setShortName(pht('Noisy APC')) + ->setName(pht('APC Has Noisy Configuration')) + ->setSummary($summary) + ->setMessage($message) + ->addPHPConfig('apc.write_lock') + ->addPHPConfig('apc.slam_defense'); + } + $is_dev = PhabricatorEnv::getEnvConfig('phabricator.developer-mode'); $is_stat_enabled = ini_get('apc.stat'); if ($is_stat_enabled && !$is_dev) {