Repository navigation
fix(worker): One storage config with a missing root no longer stops the Worker (#282) - #284
Merged
Merged
Conversation
…he Worker (#282) Worker.CrawlAllAsync now logs a failed crawl of one storage config, naming its root and user, and moves on to the next config. Before, the exception faulted the crawl BackgroundService, the default StopHost shut down the whole Worker, and restart: unless-stopped turned that into a crash loop that also blocked every other user's crawl in all-user mode. A shutdown mid-crawl still propagates (IngestionShutdown.IsInProgress) and is not logged as a failure. FileIngestionPipeline still throws for a missing root; only the per-config loop catches it. The work queue (#281) replaces this loop later. Closes #282. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The crawl failure message no longer claims a next config exists, the IngestionShutdown comment names its third caller, and the cancellation test checks the logged exception's type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #282.
Summary
One storage config whose root is missing or unreadable no longer stops the whole Worker. A failed crawl is logged with the config's root path and user, and the loop moves on to the next config.
Worker.CrawlAllAsync for each active config CrawlAsync(config) - ingestionPipeline.RunAsync(config) # root missing → throws → BackgroundService faults → StopHost + try ingestionPipeline.RunAsync(config) + catch when not a shutdown (IngestionShutdown.IsInProgress) + Log.CrawlFailed(rootPath, userId, ex) # Error; next config runsFileIngestionPipelinestill throws for a missing root. Only the per-config loop catches it.IngestionShutdowncomment names its third caller.Loading the config list itself (the database being unreachable, for example) can still stop the host. That is outside #282 and is noted on #281, which replaces this loop with the work queue.
Evidence
CrawlAllAsync_ConfigCrawlFails_LogsItsRootAndCrawlsTheNextConfigAsyncfailed, because the exception escaped and the second config was never crawled.After: it passes, together with:
ExecuteAsync_CrawlFails_KeepsRunningAndCrawlsAgainAfterTheIntervalAsync: crawl fails → timer re-armed → crawl again after 3 h, and the Worker is still running;CrawlAllAsync_ShutdownDuringACrawl_StopsWithoutLoggingAFailureAsync: throwsOperationCanceledException, no next config, no error log;CrawlAllAsync_CancellationWithoutShutdown_IsLoggedAsACrawlFailureAsync.dotnet format --verify-no-changesis clean.scripts/mutation-changed.sh: 100.00% (5 killed, 0 survived).Merge Danger
Door: two-way
Blast Radius: Worker crawl loop
A crawl error that used to crash the Worker is now logged at Error level and retried on the next interval. An operator who relied on the container restarting to notice a missing mount now has to watch the Worker logs for the error.
🤖 Generated with Claude Code