Skip to content

fix(yamux): suppress teardown log noise and optimize adaptive pacing for non-congested writes #27

Description

@SilverFire

Summary

YamuxSession and YamuxStream logged SEVERE level error tracebacks when write or read operations failed due to connection/session closure during teardown. Additionally, _adaptivePacing introduced a 1ms timer delay per frame even for fast, non-congested transports.

Problem

  • Routine socket teardown or host shutdown caused spurious SEVERE log outputs when streams attempted to send final frames or read on closed sockets.
  • Future.delayed(Duration(milliseconds: 1)) in _adaptivePacing added artificial sleeping delay per chunk during high-throughput local writes.

Proposed Fix

  • Check _closed || _connection.isClosed in _sendFrame and terminal states in YamuxStream.read before logging SEVERE errors.
  • Update _adaptivePacing to yield via Future.delayed(Duration.zero) microtask scheduling for non-congested writes.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions