Skip to content

Handle config watcher resource exhaustion in flue dev#313

Closed
kalepail wants to merge 1 commit into
withastro:mainfrom
kalepail:fix-dev-config-watch-emfile
Closed

Handle config watcher resource exhaustion in flue dev#313
kalepail wants to merge 1 commit into
withastro:mainfrom
kalepail:fix-dev-config-watch-emfile

Conversation

@kalepail

@kalepail kalepail commented Jun 19, 2026

Copy link
Copy Markdown

Summary

  • fall back to polling resolved config files when the parent flue dev config-directory watcher hits resource exhaustion (EMFILE/ENOSPC)
  • keep existing fail-fast behavior for non-resource watcher errors
  • add a regression test that forces fs.watch(projectRoot) to throw EMFILE, verifies the server starts, and verifies a config edit still restarts the dev session

Why

flue dev currently exits before starting the local server if fs.watch(directory) for the config directory throws EMFILE: too many open files, watch. In large repos or systems with watcher pressure, this prevents the normal dev path from running even though Flue already has the exact config file list it needs and can safely poll those files as a fallback.

Testing

  • pnpm --filter @flue/runtime --filter @flue/sdk --filter @flue/cli run build
  • pnpm --dir packages/cli run check:types
  • pnpm --dir packages/cli exec node --test test/dev.test.mjs

Fixes #315.

@astrobot-houston

Copy link
Copy Markdown

Thanks for the contribution! We're closing this PR and moving the conversation to the issue: #314

We've moved to a model where bugs and feature proposals are discussed in issues/discussions before code review, so the community can help prioritize and shape the work. Your branch is linked from the new thread so the implementation isn't lost — please join us there to continue the conversation.

— astrobot 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flue dev exits when config watcher hits EMFILE/ENOSPC

2 participants