Skip to content

Conversation

@bartizan
Copy link
Contributor

@bartizan bartizan commented May 5, 2025

Here is a suggestion to fix #1161

@bartizan bartizan marked this pull request as ready for review May 5, 2025 09:19
@bartizan bartizan requested a review from a team as a code owner May 5, 2025 09:19
@bartizan
Copy link
Contributor Author

bartizan commented May 5, 2025

@dotnet-policy-service agree

@waldekmastykarz
Copy link
Collaborator

Cool! We'll check it out asap! Thank you for such a quick turnaround and your contribution.

@waldekmastykarz waldekmastykarz added the pr-bugfix Fixes a bug label May 5, 2025
@waldekmastykarz waldekmastykarz requested a review from Copilot May 5, 2025 11:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a concurrency issue by replacing standard dictionaries with thread-safe ConcurrentDictionary instances across multiple components. Key changes include updating the storage for plugin data in ProxyEngine, modifying the request log buffering in ProxyConsoleFormatter, and fixing update logic in MockResponsePlugin.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
dev-proxy/ProxyEngine.cs Replaces Dictionary with ConcurrentDictionary and adds error handling
dev-proxy/Logging/ProxyConsoleFormatter.cs Updates Dictionary to ConcurrentDictionary and uses GetOrAdd
dev-proxy-plugins/Mocks/MockResponsePlugin.cs Changes Dictionary to ConcurrentDictionary and leverages AddOrUpdate

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@waldekmastykarz waldekmastykarz left a comment

Choose a reason for hiding this comment

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

Works like a charm! Thank you!

@waldekmastykarz waldekmastykarz merged commit f61443e into dotnet:main May 5, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Concurrency issue in ProxyEngine, ConcolFormatter, and MockResponsePlugin

2 participants