phacility/phabricator · error · Exception
Patch generation took longer than configured limit ("%s") of
Error message
Patch generation took longer than configured limit ("%s") of %s second(s). What it means
While publishing commit notifications, loadRawPatchText() calls diffusion.rawdiffquery with a timeout taken from the metamta.diffusion.time-limit config (PhabricatorRepositoryCommitPublishWorker.php:377-400). When generating the raw diff exceeds that many seconds, the conduit response sets tooSlow and the worker throws; the publish task then retries and keeps failing until the limit is raised or the diff becomes cheaper to compute.
Source
Thrown at src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php:394
$time_key = 'metamta.diffusion.time-limit';
$byte_key = 'metamta.diffusion.byte-limit';
$time_limit = PhabricatorEnv::getEnvConfig($time_key);
$byte_limit = PhabricatorEnv::getEnvConfig($byte_key);
$diff_info = DiffusionQuery::callConduitWithDiffusionRequest(
$viewer,
$drequest,
'diffusion.rawdiffquery',
array(
'commit' => $identifier,
'linesOfContext' => 3,
'timeout' => $time_limit,
'byteLimit' => $byte_limit,
));
if ($diff_info['tooSlow']) {
throw new Exception(
pht(
'Patch generation took longer than configured limit ("%s") of '.
'%s second(s).',
$time_key,
new PhutilNumber($time_limit)));
}
if ($diff_info['tooHuge']) {
$pretty_limit = phutil_format_bytes($byte_limit);
throw new Exception(
pht(
'Patch size exceeds configured byte size limit ("%s") of %s.',
$byte_key,
$pretty_limit));
}
$file_phid = $diff_info['filePHID'];
$file = id(new PhabricatorFileQuery())View on GitHub (pinned to 5720a38cfe)
Solutions
- Raise the limit: bin/config set metamta.diffusion.time-limit 120 (or whatever fits your largest commits)
- Improve generation speed: faster storage for the repository working copies, reduce load on the VCS host
- Re-run publishing for stuck commits after raising the limit: bin/repository reparse --message <monogram>
Example fix
# before bin/config set metamta.diffusion.time-limit 30 # after bin/config set metamta.diffusion.time-limit 300
Defensive patterns
Strategy: retry
Validate before calling
// Size the timeout before publishing: probe the repo's worst-case commit. // Raise the config to cover it: // bin/config set metamta.diffusion.time-limit 300 // Larger than the slowest 'git show'/'svn diff' of your biggest commit.
Try / catch
try {
$patch = $this->loadRawPatchText($repository, $commit);
} catch (Exception $ex) {
// tooSlow is transient for the task: after raising
// metamta.diffusion.time-limit, let the worker retry (it will), or
// manually requeue: bin/repository reparse --message <monogram>
phlog($ex);
throw $ex;
} Prevention
- Set metamta.diffusion.time-limit above the slowest diff generation in your history (measure with git show on the largest commit)
- Keep repository working copies on fast local storage
- Watch the publish queue for repeated tooSlow failures after big merges
When it happens
Trigger: A commit whose raw diff (3 lines of context) takes longer than metamta.diffusion.time-limit seconds to generate: giant merges, huge tree rewrites, binary-heavy commits, or mirrors on slow network storage.
Common situations: Monorepos with enormous commits; default limits too tight for the repository's normal history; initial imports flooding the publish queue; slow I/O on the daemon host.
Related errors
- Patch size exceeds configured byte size limit ("%s") of %s.
- Unable to upload file: this server is not configured with an
- No configured mailers support outbound messages of type "%s"
- Mailer key ("%s") is not configured, or does not support out
- Application email ("%s") has an invalid default author ("%s"
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/9b9fac308add31bb.
Report an issue: GitHub.