Skip to content

Expose identifier for a connection bundle #406

Open
@avieth

Description

@avieth
-- Identifies a "heavyweight" connection which carries 0 or more "lightweight"
-- connections.
type ConnectionBundle = Word32

data ErrorEvent =
 ...
    -- EventConnectionLost indicates which bundle was lost
  | EventConnectionLost EndPointAddress ConnectionBundle
  ...

data Connection = Connection {
    ...
    -- Each connection knows which bundle carries it.
  , bundle :: ConnectionBundle
  }

Why?

When a connection is lost, an EventConnectionLost peer must be posted and ultimately come out of receive at that end point before any ConnectionOpened events to the same peer. While that event sits in the queue, new connections may be established to that same peer. Once the EventConnectionLost peer comes out of the queue it's impossible to determine which of the existing outbound lightweight connections are affected by it. By including a ConnectionBundle on every Connection and on the EventConnectionLost, it's possible to determine whether an outbound connection has been severed without trying to send on it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions