Page MenuHomePhabricator

D9055.diff
No OneTemporary

D9055.diff

diff --git a/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php b/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php
--- a/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php
+++ b/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php
@@ -55,6 +55,8 @@
*/
final class PhabricatorRepositoryGraphCache {
+ private $rebuiltKeys = array();
+
/* -( Querying the Graph Cache )------------------------------------------- */
@@ -282,6 +284,20 @@
* @task cache
*/
private function rebuildBucket($bucket_key, array $current_data) {
+
+ // First, check if we've already rebuilt this bucket. In some cases (like
+ // browsing a repository at some commit) it's common to issue many lookups
+ // against one commit. If that commit has been discovered but not yet
+ // fully imported, we'll repeatedly attempt to rebuild the bucket. If the
+ // first rebuild did not work, subsequent rebuilds are very unlikely to
+ // have any effect. We can just skip the rebuild in these cases.
+
+ if (isset($this->rebuiltKeys[$bucket_key])) {
+ return $current_data;
+ } else {
+ $this->rebuiltKeys[$bucket_key] = true;
+ }
+
$bucket_min = ($bucket_key * $this->getBucketSize());
$bucket_max = ($bucket_min + $this->getBucketSize()) - 1;

File Metadata

Mime Type
text/plain
Expires
Sat, May 18, 7:10 AM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6299675
Default Alt Text
D9055.diff (1 KB)

Event Timeline