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 Client] Track Two (Timer Dispose Fix) #9156

Merged
merged 1 commit into from
Dec 18, 2019

Conversation

jsquire
Copy link
Member

@jsquire jsquire commented Dec 16, 2019

Summary

The focus of these changes is to address a race condition that could cause the authorization refresh timer callback to throw an ObjectDisposedException due to a set of benign race conditions. These changes attempt to make those conditions less likely but cannot eliminate them completely without introducing synchronization overhead. Because the condition is benign, accept the resulting exception as an expected case rather than paying that cost.

Last Upstream Rebase

Monday, December 16, 3:18pm (EST)

Related and Follow-Up Issues

@jsquire jsquire added Event Hubs Client This issue points to a problem in the data-plane of the library. labels Dec 16, 2019
@jsquire jsquire added this to the [2020] January milestone Dec 16, 2019
@jsquire jsquire self-assigned this Dec 16, 2019
@@ -754,6 +754,11 @@ protected virtual TimeSpan CalculateLinkAuthorizationRefreshInterval(DateTime ex

try
{
if (refreshTimer == null)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This will help reduce the potential for occurrence, but does not eliminate it as the Dispose call could be taking place as the timer callback is invoked.

Copy link
Member

@kinelski kinelski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

The focus of these changes is to address a race condition that could
cause the authorization refresh timer callback to throw an ObjectDisposedException
due to a set of benign race conditions.  These changes attempt to make those
conditions less likely but cannot elimitate them completely without introducing
synchronization overhead.  Because the condition is benign, accept the
resulting exception as an expected case rather than paying that cost.
@jsquire jsquire force-pushed the eventhubs/amqpscope-timer-fix branch from 0c0261f to 36093bc Compare December 18, 2019 20:08
@jsquire jsquire merged commit 8b8cdfd into Azure:master Dec 18, 2019
@jsquire jsquire deleted the eventhubs/amqpscope-timer-fix branch December 18, 2019 20:34
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