Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14352835
D16585.id39920.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D16585.id39920.diff
View Options
diff --git a/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php b/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php
--- a/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php
+++ b/src/applications/repository/engine/PhabricatorRepositoryDiscoveryEngine.php
@@ -682,7 +682,32 @@
$data['commitID'] = $commit->getID();
- PhabricatorWorker::scheduleTask($class, $data);
+ // If the repository is importing for the first time, we schedule tasks
+ // at IMPORT priority, which is very low. Making progress on importing a
+ // new repository for the first time is less important than any other
+ // daemon task.
+
+ // If the repostitory has finished importing and we're just catching up
+ // on recent commits, we schedule discovery at COMMIT priority, which is
+ // slightly below the default priority.
+
+ // Note that followup tasks and triggered tasks (like those generated by
+ // Herald or Harbormaster) will queue at DEFAULT priority, so that each
+ // commit tends to fully import before we start the next one. This tends
+ // to give imports fairly predictable progress. See T11677 for some
+ // discussion.
+
+ if ($repository->isImporting()) {
+ $task_priority = PhabricatorWorker::PRIORITY_IMPORT;
+ } else {
+ $task_priority = PhabricatorWorker::PRIORITY_COMMIT;
+ }
+
+ $options = array(
+ 'priority' => $task_priority,
+ );
+
+ PhabricatorWorker::scheduleTask($class, $data, $options);
}
private function isInitialImport(array $refs) {
diff --git a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
--- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
+++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
@@ -47,6 +47,14 @@
$this->getFollowupTaskClass(),
array(
'commitID' => $commit->getID(),
+ ),
+ array(
+ // We queue followup tasks at default priority so that the queue
+ // finishes work it has started before starting more work. If
+ // followups are queued at the same priority level, we do all
+ // message parses first, then all change parses, etc. This makes
+ // progress uneven. See T11677 for discussion.
+ 'priority' => PhabricatorWorker::PRIORITY_DEFAULT,
));
}
}
diff --git a/src/infrastructure/daemon/workers/PhabricatorWorker.php b/src/infrastructure/daemon/workers/PhabricatorWorker.php
--- a/src/infrastructure/daemon/workers/PhabricatorWorker.php
+++ b/src/infrastructure/daemon/workers/PhabricatorWorker.php
@@ -16,6 +16,7 @@
const PRIORITY_ALERTS = 1000;
const PRIORITY_DEFAULT = 2000;
+ const PRIORITY_COMMIT = 2500;
const PRIORITY_BULK = 3000;
const PRIORITY_IMPORT = 4000;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 2:56 PM (21 h, 5 s)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6910885
Default Alt Text
D16585.id39920.diff (3 KB)
Attached To
Mode
D16585: Do initial repository imports at a lower priority and finish importing commits before starting new ones
Attached
Detach File
Event Timeline
Log In to Comment