Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14009013
D19503.id46640.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D19503.id46640.diff
View Options
diff --git a/src/applications/transactions/engineextension/PhabricatorTransactionsFulltextEngineExtension.php b/src/applications/transactions/engineextension/PhabricatorTransactionsFulltextEngineExtension.php
--- a/src/applications/transactions/engineextension/PhabricatorTransactionsFulltextEngineExtension.php
+++ b/src/applications/transactions/engineextension/PhabricatorTransactionsFulltextEngineExtension.php
@@ -22,12 +22,28 @@
return;
}
- $xactions = $query
+ $query
->setViewer($this->getViewer())
->withObjectPHIDs(array($object->getPHID()))
->withComments(true)
- ->needComments(true)
- ->execute();
+ ->needComments(true);
+
+ // See PHI719. Users occasionally create objects with huge numbers of
+ // comments, which can be slow to index. We handle this with reasonable
+ // grace: at time of writing, we can index a task with 100K comments in
+ // about 30 seconds. However, we do need to hold all the comments in
+ // memory in the AbstractDocument, so there's some practical limit to what
+ // we can realistically index.
+
+ // Since objects with more than 1,000 comments are not likely to be
+ // legitimate objects with actual discussion, index only the first
+ // thousand comments.
+
+ $query
+ ->setOrderVector(array('-id'))
+ ->setLimit(1000);
+
+ $xactions = $query->execute();
foreach ($xactions as $xaction) {
if (!$xaction->hasComment()) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 31, 8:35 AM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6721323
Default Alt Text
D19503.id46640.diff (1 KB)
Attached To
Mode
D19503: Index only the first 1,000 comments on any object
Attached
Detach File
Event Timeline
Log In to Comment