1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-21 22:32:41 +01:00

Use "@" to silence "GC list" warnings from "apc_store()" and "apcu_store()"

Summary:
Fixes T13525. Since D21044, the intermittent GC list warnings are treated more severely and can become user-visible errors.

Silence them, since this seems to be the only realistic response in most versions of APC/APCu.

Test Plan: Will deploy.

Maniphest Tasks: T13525

Differential Revision: https://secure.phabricator.com/D21179
This commit is contained in:
epriestley 2020-04-28 03:53:40 -07:00
parent aa20faeaa5
commit 5eaa0f24e7
2 changed files with 11 additions and 8 deletions

View file

@ -47,11 +47,14 @@ final class PhutilAPCKeyValueCache extends PhutilKeyValueCache {
// NOTE: Although modern APC supports passing an array to `apc_store()`, // NOTE: Although modern APC supports passing an array to `apc_store()`,
// it is not supported by older version of APC or by HPHP. // it is not supported by older version of APC or by HPHP.
// See T13525 for discussion of use of "@" to silence this warning:
// > GC cache entry "<some-key-name>" was on gc-list for <X> seconds
foreach ($keys as $key => $value) { foreach ($keys as $key => $value) {
if ($is_apcu) { if ($is_apcu) {
apcu_store($key, $value, $ttl); @apcu_store($key, $value, $ttl);
} else { } else {
apc_store($key, $value, $ttl); @apc_store($key, $value, $ttl);
} }
} }

View file

@ -216,9 +216,9 @@ abstract class PhabricatorClientLimit {
$bucket[$client_key] += $score; $bucket[$client_key] += $score;
if ($is_apcu) { if ($is_apcu) {
apcu_store($bucket_key, $bucket); @apcu_store($bucket_key, $bucket);
} else { } else {
apc_store($bucket_key, $bucket); @apc_store($bucket_key, $bucket);
} }
return $this; return $this;
@ -247,9 +247,9 @@ abstract class PhabricatorClientLimit {
$cur = $this->getCurrentBucketID(); $cur = $this->getCurrentBucketID();
if (!$min) { if (!$min) {
if ($is_apcu) { if ($is_apcu) {
apcu_store($min_key, $cur); @apcu_store($min_key, $cur);
} else { } else {
apc_store($min_key, $cur); @apc_store($min_key, $cur);
} }
$min = $cur; $min = $cur;
} }
@ -262,10 +262,10 @@ abstract class PhabricatorClientLimit {
$bucket_key = $this->getBucketCacheKey($cursor); $bucket_key = $this->getBucketCacheKey($cursor);
if ($is_apcu) { if ($is_apcu) {
apcu_delete($bucket_key); apcu_delete($bucket_key);
apcu_store($min_key, $cursor + 1); @apcu_store($min_key, $cursor + 1);
} else { } else {
apc_delete($bucket_key); apc_delete($bucket_key);
apc_store($min_key, $cursor + 1); @apc_store($min_key, $cursor + 1);
} }
} }