Skip to content

Error handling is too brittle for Windows IpcStreamFactory/IPC PAL #41007

Description

@josalem

If a Connect Diagnostic Port doesn't explicitly call DisconnectNamedPipe before closing the handle, the error handling in the runtime will erroneously treat this as a generic error rather than a hangup. The if statement currently only marks ERROR_PIPE_NOT_CONNECTED as a hangup, but should also treat ERROR_PIPE_BROKEN as a hangup. The current error path also does not reset the connection, so the cache is still there on subsequent loops through IpcStreamFactory::GetNextAvailableStream which leaves us waiting on handles that no longer are attached to anything.

The fix is simple and twofold: reset connections on the error path & map ERROR_PIPE_BROKEN to the hangup state rather than error state. The PR is incoming.

CC @tommcdon @sywhang @noahfalk @jander-msft

Activity

  1. added this to the 5.0.0 milestone on Aug 19, 2020
  2. self-assigned this
    on Aug 19, 2020
  3. added
    untriaged
    on Aug 19, 2020
  4. josalem commented on Aug 19, 2020

    @josalem
    ContributorAuthor

    See dotnet/diagnostics#1420 (comment) for a description of the issue

  5. removed
    untriaged
    on Aug 19, 2020
  6. ghost locked as resolved and limited conversation to collaborators on Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions