Skip to content

Synchronize ConsumerClient::Close with concurrent resource creation #7355

Description

@j7nw4r

Summary

ConsumerClient::Close accesses the session and connection maps without m_sessionsLock while resource creation writes those maps under the lock.

Motivation

The unlocked access is a data race. Detaching the maps under the lock addresses map mutation, but a complete fix must also define calls that overlap the gap between EnsureSession and GetSession. This behavior predates pull request #7354 and is outside its teardown failure scope.

Proposal

  • Define the ConsumerClient concurrency contract for Close and CreatePartitionClient.
  • Detach cached sessions and connections while holding m_sessionsLock.
  • Run blocking AMQP teardown after releasing the lock.
  • Add deterministic coverage for Close that overlaps resource creation.

Found while reviewing #7354.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.Event Hubs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions