Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Hubs] Fixed producer semaphore release #47965

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jsquire
Copy link
Member

@jsquire jsquire commented Jan 24, 2025

Summary

The focus of these changes is to fox an obscure edge case in the EventHubBufferedProducer client where an obscure race condition when flushing/enqueuing events concurrently with disposing the producer could cause a semaphore to be released inappropriately. This error superseded the TaskCanceledException that should have been surfaced. Also moved to volatile reads for the total buffer count when making state-related decisions, to ensure that the most recent value is used.

Also included is removal of the invalid proxy tests. These have long been flaky due to behavioral differences between platforms and target runtimes. At this point, the assertions have become very loose and allow for an expanded set of conditions to compensate. After review, I don't believe that they're offering any real value in their current form and are really testing network/platform behavior rather than the Azure clients.

The focus of these changes is to fox an obscure edge case in the
`EventHubBufferedProducer` client where an obscure race condition when
flushing/enqueuing events concurrently with disposing the producer could
cause a semaphore to be released inappropriately.  This error superseded
the `TaskCanceledException` that should have been surfaced.

Also moved to volatile reads for the total buffer count when making
state-related decisions, to ensure that the most recent value is used.
@jsquire jsquire added Event Hubs Client This issue points to a problem in the data-plane of the library. labels Jan 24, 2025
@jsquire jsquire added this to the 2025-02 milestone Jan 24, 2025
@jsquire jsquire self-assigned this Jan 24, 2025
@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@jsquire
Copy link
Member Author

jsquire commented Jan 24, 2025

/azp run net - eventhub - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jsquire
Copy link
Member Author

jsquire commented Jan 24, 2025

/azp run net - eventhub - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jsquire jsquire requested a review from jeo02 January 24, 2025 21:44
@jsquire
Copy link
Member Author

jsquire commented Jan 25, 2025

/azp run net - eventhub - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Event Hubs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants