Skip to content

[jaspr_content] Avoid file descriptor exhaustion during an eager load#770

Merged
schultek merged 4 commits intoschultek:mainfrom
parlough:fix/file-descriptor-exhaustion
Mar 12, 2026
Merged

[jaspr_content] Avoid file descriptor exhaustion during an eager load#770
schultek merged 4 commits intoschultek:mainfrom
parlough:fix/file-descriptor-exhaustion

Conversation

@parlough
Copy link
Copy Markdown
Contributor

@parlough parlough commented Mar 5, 2026

Some contributors were hitting this on macOS when building docs.flutter.dev, since the load call ran until it awaited I/O calls. Then by the time we awaited the results of the loads, potentially many file descriptors were open.

To avoid this case, when eagerly loading page sources:

  • Don't call load on them right away, just track the sources themselves.
  • After each source is tracked, load them in batches.

@docs-page
Copy link
Copy Markdown

docs-page Bot commented Mar 5, 2026

To view this pull requests documentation preview, visit the following URL:

docs.page/schultek/jaspr~770

Documentation is deployed and generated using docs.page.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

Package Version Report

The following packages have been updated:
jaspr_content : 0.5.0 -> 0.5.1

@parlough parlough force-pushed the fix/file-descriptor-exhaustion branch from de71f0e to 7000a97 Compare March 5, 2026 13:11
@parlough parlough marked this pull request as ready for review March 5, 2026 13:13
@parlough parlough requested a review from schultek as a code owner March 5, 2026 13:13
@parlough parlough force-pushed the fix/file-descriptor-exhaustion branch from 7000a97 to a958360 Compare March 9, 2026 07:32
@parlough
Copy link
Copy Markdown
Contributor Author

parlough commented Mar 9, 2026

@schultek Any thoughts on this solution? At first I considered adjusting the load logic itself, but this seemed more flexible as weren't not in control of the load logic. It could come from a third-party PageSource implementation.

Copy link
Copy Markdown
Owner

@schultek schultek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Direction looks good, just think we can tweak the parallelization a bit.

Comment thread packages/jaspr_content/lib/src/route_loader/route_loader.dart Outdated
Comment thread packages/jaspr_content/lib/src/route_loader/route_loader.dart Outdated
@parlough parlough requested a review from schultek March 12, 2026 14:31
Copy link
Copy Markdown
Owner

@schultek schultek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes, LGTM now.

@schultek schultek merged commit 362af12 into schultek:main Mar 12, 2026
3 checks passed
@parlough parlough deleted the fix/file-descriptor-exhaustion branch March 12, 2026 17:54
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.

2 participants