Skip to content
New issue

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

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

Already on GitHub? # to your account

[mono][debugger] Concurrency on execution context dictionary #87870

Merged
merged 4 commits into from
Jun 21, 2023

Conversation

thaystg
Copy link
Member

@thaystg thaystg commented Jun 21, 2023

Follow up of this #87154

@ghost
Copy link

ghost commented Jun 21, 2023

Tagging subscribers to this area: @thaystg
See info in area-owners.md if you want to be subscribed.

Issue Details

Follow up of this #87154

Author: thaystg
Assignees: -
Labels:

area-Debugger-mono

Milestone: -

return false;
if (contextBag.IsEmpty)
return false;
executionContext = contextBag.Where(context => context.Id == contextBag.Where(context => context.Destroyed == false).Max(context => context.Id)).FirstOrDefault();
Copy link
Member

Choose a reason for hiding this comment

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

This should work, right? Fine for a follow up PR.

Suggested change
executionContext = contextBag.Where(context => context.Id == contextBag.Where(context => context.Destroyed == false).Max(context => context.Id)).FirstOrDefault();
int maxId = contextBag.Where(context => context.Destroyed == false).Max(context => context.Id);
executionContext = contextBag.Where(context => context.Id == maxId).FirstOrDefault();

Comment on lines +561 to +562
contexts[workerSessionId] = new();
contexts[workerSessionId].Add(context.CreateChildAsyncExecutionContext(workerSessionId));
Copy link
Member

Choose a reason for hiding this comment

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

Use TryGetAndAddContext

@radical
Copy link
Member

radical commented Jun 21, 2023

Failure is unrelated:

Test Run Aborted with error System.Exception: One or more errors occurred.
 ---> System.Exception: Unable to read beyond the end of the stream.
   at System.IO.BinaryReader.Read7BitEncodedInt()
   at System.IO.BinaryReader.ReadString()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.LengthPrefixCommunicationChannel.NotifyDataAvailable() in /_/src/Microsoft.TestPlatform.CommunicationUtilities/LengthPrefixCommunicationChannel.cs:line 90
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TcpClientExtensions.MessageLoopAsync(TcpClient client, ICommunicationChannel channel, Action`1 errorHandler, CancellationToken cancellationToken) in /_/src/Microsoft.TestPlatform.CommunicationUtilities/TcpClientExtensions.cs:line 53
   --- End of inner exception stack trace ---.

@radical radical merged commit 927ef08 into dotnet:main Jun 21, 2023
thaystg added a commit to thaystg/runtime that referenced this pull request Jul 3, 2023
thaystg added a commit to thaystg/runtime that referenced this pull request Jul 3, 2023
thaystg added a commit that referenced this pull request Jul 10, 2023
…fter vscode-js-debug bump on VS (#88351)

* Backport #87154 #87870 #87979

* fix compilation error
thaystg added a commit that referenced this pull request Jul 10, 2023
…fter vscode-js-debug bump on VS (#88336)

* Backport #87154 #87870 #87979

* fix compilation

* Backporting more changes
@ghost ghost locked as resolved and limited conversation to collaborators Jul 22, 2023
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants