Read ahead: resolve paths before opening connections; a failing readAhead() leaves no spool folder

This commit is contained in:
2026-10-19 01:52:58 +02:00
parent ccbbf01c54
commit 1d7f7e6423
2 changed files with 7 additions and 2 deletions
+5 -1
View File
@@ -254,7 +254,11 @@ final class Repository {
if (count($plan->ranges()) < 2 || (!is_dir($plan->spool) && !@mkdir($plan->spool, 0700, true))) {
return null;
}
$streams = $this->backend->readAhead($plan->ranges(), $plan->spool);
try {
$streams = $this->backend->readAhead($plan->ranges(), $plan->spool);
} catch (\Throwable) {
$streams = null; // the usual reads report what is wrong
}
if ($streams === null) {
@rmdir($plan->spool);
return null;