Skip to content

Deadlock when using operator> on a stream that emits more than 16KiB #51

@Goodwine

Description

@Goodwine

Context: https://gist.github.com/nex3/4aee4b681ffddf6480ea20dc75f8ad26

#50

    test("does not block with a large chunk of data", () async {
      var payloadSize = (1 << 16) + 1;
      // This must be an actual script. [Script.capture] won't fail.
      var script = mainScript('stderr.write("." * $payloadSize);');
      var controller = StreamController<List<int>>();
      script.stderr > controller.sink;

      await script.done;

      expect((await controller.stream.text).length, payloadSize);
    }, timeout: Timeout(Duration(seconds: 3)));

The issue comes from dart core libraries and is not cli_script-specific. However this may be considered WAI by Dart so it should be handled automatically.

I was able to repro with Process and Script.fromBytesBufferTransformer. However, the latter doesn't require a full payload so maybe each blocks for different reasons 🤔

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions