Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15412970
D19455.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D19455.diff
View Options
diff --git a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
--- a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
+++ b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
@@ -37,6 +37,7 @@
private $rejectDetails;
private $emailPHIDs = array();
private $changesets = array();
+ private $changesetsSize = 0;
/* -( Config )------------------------------------------------------------- */
@@ -1121,11 +1122,22 @@
return;
}
+ // See T13142. Don't cache more than 64MB of changesets. For normal small
+ // pushes, caching everything here can let us hit the cache from Herald if
+ // we need to run content rules, which speeds things up a bit. For large
+ // pushes, we may not be able to hold everything in memory.
+ $cache_limit = 1024 * 1024 * 64;
+
foreach ($content_updates as $update) {
$identifier = $update->getRefNew();
try {
- $changesets = $this->loadChangesetsForCommit($identifier);
- $this->changesets[$identifier] = $changesets;
+ $info = $this->loadChangesetsForCommit($identifier);
+ list($changesets, $size) = $info;
+
+ if ($this->changesetsSize + $size <= $cache_limit) {
+ $this->changesets[$identifier] = $changesets;
+ $this->changesetsSize += $size;
+ }
} catch (Exception $ex) {
$this->changesets[$identifier] = $ex;
@@ -1207,7 +1219,11 @@
$changes = $parser->parseDiff($raw_diff);
$diff = DifferentialDiff::newEphemeralFromRawChanges(
$changes);
- return $diff->getChangesets();
+
+ $changesets = $diff->getChangesets();
+ $size = strlen($raw_diff);
+
+ return array($changesets, $size);
}
public function getChangesetsForCommit($identifier) {
@@ -1221,7 +1237,9 @@
return $cached;
}
- return $this->loadChangesetsForCommit($identifier);
+ $info = $this->loadChangesetsForCommit($identifier);
+ list($changesets, $size) = $info;
+ return $changesets;
}
public function loadCommitRefForCommit($identifier) {
diff --git a/src/applications/diffusion/herald/HeraldCommitAdapter.php b/src/applications/diffusion/herald/HeraldCommitAdapter.php
--- a/src/applications/diffusion/herald/HeraldCommitAdapter.php
+++ b/src/applications/diffusion/herald/HeraldCommitAdapter.php
@@ -207,7 +207,7 @@
}
public static function getEnormousByteLimit() {
- return 1024 * 1024 * 1024; // 1GB
+ return 256 * 1024 * 1024; // 256MB. See T13142 and T13143.
}
public static function getEnormousTimeLimit() {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 4:04 PM (5 h, 51 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7710282
Default Alt Text
D19455.diff (2 KB)
Attached To
Mode
D19455: Improve some behaviors around memory pressure when pushing many and/or large changes
Attached
Detach File
Event Timeline
Log In to Comment