Skip to content

Websocket AsyncHandshake callback might starve go-routines trying to ioc.Post() #159

Description

@sergiu128

Within websocket/stream.go, the async handshake is done in another go-routine (no async dial for TCP nor TLS yet, so we "fake" it). If successful, the caller's callback is invoked by Posting it from the handshake goroutine in sonic's goroutine (and hence the caller's goroutine).

Within that callback we might be compute bound for a long time or just start reading from the socket, where all reads are immediate up to a constant limit. While the callback is running, the Post lock might be held for long enough to noticeably starve other go-routines that are Posting.

Unsure yet how to bypass this.

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