Skip to content

Fixes concurrency issue in ProxyEngine, ConcolFormatter, and MockResponsePlugin #1161 #1162

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

Merged
merged 7 commits into from
May 5, 2025

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 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