Skip to content

Non-Dart Tool invocations aren't throttled #2728

Closed
@gspencergoog

Description

@gspencergoog

If I swap the snippets tool in Flutter's repo with the following "slow_command"script:

#!/bin/bash

# Runs slowly because it never gets snapshotted.
dart /home/gspencer/code/flutter/dev/snippets/lib/main.dart "$@"

by using this config:

# This file is used by dartdoc when generating API documentation for Flutter.
dartdoc:
  # Before you can run dartdoc, the snippets tool needs to have a snapshot built.
  # The dev/tools/dartdoc.dart script does this automatically.
  tools:
    snippet:
      command: ["slow_command", "--type=snippet"]
      description: "Creates sample code documentation output from embedded documentation samples."
    sample:
      command: ["slow_command", "--type=sample"]
      description: "Creates full application sample code documentation output from embedded documentation samples."
    dartpad:
      command: ["slow_command", "--type=sample", "--dartpad"]
      description: "Creates full application sample code documentation output from embedded documentation samples and displays it in an embedded DartPad."
  errors:
    # Default errors of dartdoc:
    - duplicate-file
    - invalid-parameter
    - no-defining-library-found
    - tool-error
    - unresolved-export
    # Warnings that are elevated to errors:
    - ambiguous-doc-reference
    - ambiguous-reexport
    - broken-link
    - category-order-gives-missing-package-name
    - deprecated
    - ignored-canonical-for
    - missing-from-search-index
    - no-canonical-found
    - no-documentable-libraries
    - no-library-level-docs
    - not-implemented
    - orphaned-file
    - reexported-private-api-across-packages
    # - unknown-directive  # Disabled due to https://github.com/dart-lang/dartdoc/issues/2353
    - unknown-file
    - unknown-macro
    - unresolved-doc-reference

Then it seems to run out of control, and I can get my load average up to >1000:
Screen Shot 2021-08-04 at 8 11 30 AM

This doesn't happen if I keep the regular flutter config that runs a snapshotted version of the same script.

I'm trying to convert the snippet tool over to be run using pub global run from a package, and the lack of throttling is preventing that. I know that there is throttling code, but I just don't think it's working for non-dart tools.

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work oncustomer-flutterIssues originating from important to Fluttertype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions