Skip to content

Upstream: Ignore CommandType.Done with null Destination in SocketBase #4

Description

@follesoe

Patch

Commit `47bdc293`Ignore processing CommandType.Done with null Destination (Thierry Matthey, 2024-07-29).

Files: `src/NetMQ/Core/SocketBase.cs` (3 lines)

Came in via merge commits `5714d52b` and `80831cec` from external branch `tmatthey/pr/check-destination-null` (author: Thierry Matthey at SLB / @tmatthey).

There was an earlier attempt (`7f9fb678` "If there is no destination ... just skip it.") that was reverted in `47b422d8`; the surviving `47bdc293` is the cleaner replacement.

What the patch does

Skips processing of `CommandType.Done` commands whose `Destination` field is null, instead of dereferencing it. Avoids a null-reference crash during socket shutdown when a Done command arrives after its target socket has already been collected.

Origin / sources

  • External author: Thierry Matthey (SLB) — branch `tmatthey/pr/check-destination-null`
  • Not yet submitted upstream as of last check.

Upstreaming work

  • Get original repro from Thierry / SLB if possible — when does `Destination` come in null?
  • Construct a deterministic test: shut down a socket while a peer has a pending Done command in flight, verify no NRE.
  • Coordinate with @tmatthey on co-authorship for the upstream PR.
  • Discuss with upstream whether the right fix is to skip silently, log, or fix the producer side.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions