Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

[#6591] Concurrency issue with TimeZoneConverter - #6593

Merged
tracyboehrer merged 2 commits into
mainfrom
southworks/fix/concurrent-issue-timezoneconverter
Feb 23, 2023
Merged

[#6591] Concurrency issue with TimeZoneConverter#6593
tracyboehrer merged 2 commits into
mainfrom
southworks/fix/concurrent-issue-timezoneconverter

Conversation

@ceciliaavila

Copy link
Copy Markdown
Collaborator

Fixes #6591

Description

This PR fixes the concurrency issue in the TimeZoneConverter class by changing the Dictionaries to be thread-safe and also adding a static constructor to the class to execute the LoadData method only once.

Specific Changes

  • Updated TimeZoneConverter class adding a static constructor and using ConcurrentDictionary.

Testing

Here we can see concurrent tests failing before the changes and the same tests passing after the changes.
image

@ceciliaavila ceciliaavila added the Automation: No parity PR does not need to be applied to other languages. label Feb 23, 2023
@ceciliaavila
ceciliaavila requested a review from a team as a code owner February 23, 2023 15:41
@ceciliaavila

Copy link
Copy Markdown
Collaborator Author

Hi @tracyboehrer, this is the fix for the concurrency issue.

@coveralls

Copy link
Copy Markdown
Collaborator

Pull Request Test Coverage Report for Build 341679

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.003%) to 79.106%

Files with Coverage Reduction New Missed Lines %
/libraries/AdaptiveExpressions/BuiltinFunctions/GetNextViableTime.cs 1 90.91%
/libraries/integration/Microsoft.Bot.Builder.Integration.AspNet.Core/ServiceCollectionExtensions.cs 1 93.55%
/libraries/Microsoft.Bot.Connector.Streaming/Application/TimerAwaitable.cs 1 68.25%
/libraries/AdaptiveExpressions/TimeZoneConverter.cs 2 88.0%
Totals Coverage Status
Change from base Build 340498: -0.003%
Covered Lines: 25829
Relevant Lines: 32651

💛 - Coveralls

@johnataylor

Copy link
Copy Markdown
Contributor

:shipit:

@tracyboehrer
tracyboehrer merged commit c30b85e into main Feb 23, 2023
@tracyboehrer
tracyboehrer deleted the southworks/fix/concurrent-issue-timezoneconverter branch February 23, 2023 20:07
tracyboehrer pushed a commit that referenced this pull request Feb 23, 2023
* Use ConcurrentDictionary in TimeZoneConverter

* Add static constructor
This was referenced May 14, 2026
This was referenced May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Automation: No parity PR does not need to be applied to other languages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Concurrency issue with TimeZoneConverter

4 participants