GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(utils): keep coroutine pool workers running when a job throws by pty3595 · Pull Request #458 · deepseek-ai/3FS

Conversation

@pty3595

@pty3595 pty3595 commented Nov 25, 2026

Copy link
Copy Markdown

CoroutinesPool::run and PriorityCoroutinePool::run await the job handler without catching (co_await handler(std::move(*result));). If a job throws, that pool coroutine ends: nothing is logged, the exception stays in its SemiFuture until stopAndJoin(), and the coroutine is not replaced. Every throwing job removes one worker until the process restarts.

In meta this hits GC hardest. GcManager runs GC tasks on a PriorityCoroutinePool with gc.workers.coroutines_num workers (8 by default). GC loses one worker per throwing task, and after 8 throws it stops: meta keeps serving, but deleted files are not reclaimed until meta is restarted. SessionManager's close and scan pools have the same problem.

We hit this on an aarch64 meta built with clang 14, where the CO_RETURN_ON_ERROR message at src/meta/components/FileHelper.cc:128 sometimes throws fmt::format_error (a separate codegen issue) when chunk removal fails.

The fix awaits the handler with co_awaitTry, logs the exception at ERR and keeps the coroutine running. The job that threw is still dropped. For GC, runGcTask releases the entry in a SCOPE_EXIT, so the file is picked up again by a later scan (in the test-cluster run below, every deleted file was reclaimed).

Validation

Built on aarch64 with Ubuntu clang 14.0.6, RelWithDebInfo, on 2dcbff5:

  • New TestCoroutinesPool.JobThrows and TestPriorityCoroutinePool.JobThrows: a pool with 2 coroutines gets one throwing job per coroutine, then 100 normal jobs. Without the fix both fail (0 of 100 jobs run); with the fix both pass. 3 runs each.
  • Existing TestCoroutinesPool.* and TestDynamicCoroutinesPool.* pass with and without the fix. TestGcManager.*: 4 of 5 pass with and without the fix; recursive fails at TestGcManager.cc:217 on unmodified main in our environment too.
  • On a test cluster, with the aarch64 clang 14 meta and gc.workers.coroutines_num = 1, storage paused for 20 s per cycle so chunk removal fails: without the fix, each of the 2 format_errors stopped GC while meta kept serving, until meta was restarted. With the fix, the pool logged 18 format_errors over 13 cycles and GC reclaimed every deleted file.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@pty3595
fix(utils): keep coroutine pool workers running when a job throws
ec44faf
CoroutinesPool::run and PriorityCoroutinePool::run awaited the job
handler without catching. A job that threw ended its pool coroutine for
good, with nothing logged, so every throwing job removed one worker
until the process restarted. For the meta GC (8 workers by default),
GC stopped while meta kept serving once 8 GC tasks had thrown.

Await the handler with co_awaitTry, log the exception and keep the
coroutine running. The job that threw is dropped as before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@pty3595
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.