Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(console): add large future lints #587

Merged
merged 6 commits into from
Oct 9, 2024
Merged

feat(console): add large future lints #587

merged 6 commits into from
Oct 9, 2024

Commits on Oct 8, 2024

  1. feat(console): add large future lints

    In Tokio, the futures for tasks are stored on the stack unless they are
    explicitly boxed. Having very large futures can be problematic as it can
    cause a stack overflow.
    
    This change makes use of new instrumentation in Tokio
    (tokio-rs/tokio#6881) which includes the size of the future which drives
    a task. The size isn't given its own column (we're running out of
    horizontal space) and appears in the additional fields column. In the
    case that a future was auto-boxed by Tokio, the original size of the
    task will also be provided.
    
    Two new lints have been added for large futures. The first will detect
    auto-boxed futures and warn about them. The second will detect futures
    which are large (over 1024 bytes by default), but have not been
    auto-boxed by the runtime.
    
    Since the new lints depend on the new instrumentation in Tokio, they
    will only trigger if the instrumented application is running using
    `tokio` 1.41.0 or later. The version is as yet, unreleased.
    
    Both lints have been added to the default list.
    hds committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    d5af179 View commit details
    Browse the repository at this point in the history
  2. Apply suggestions from code review

    Co-authored-by: Eliza Weisman <[email protected]>
    hds and hawkw authored Oct 8, 2024
    Configuration menu
    Copy the full SHA
    d0991ca View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    31bfb7a View commit details
    Browse the repository at this point in the history
  4. reduce large blocking example size

    It was causing a stack overflow when run on tokio 1.40.0.
    hds committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    cd83fbc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    39ea7a9 View commit details
    Browse the repository at this point in the history
  6. fixed cli-ui tests

    hds committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    e5c1ebb View commit details
    Browse the repository at this point in the history