Ensure we don't call out into arbitrary code directly when setting up our cache state#63132
Merged
CyrusNajmabadi merged 7 commits intodotnet:mainfrom Aug 2, 2022
Merged
Ensure we don't call out into arbitrary code directly when setting up our cache state#63132CyrusNajmabadi merged 7 commits intodotnet:mainfrom
CyrusNajmabadi merged 7 commits intodotnet:mainfrom
Conversation
CyrusNajmabadi
commented
Aug 2, 2022
| // cache state in RemoteWorkspace must always run fully to completion without issue. We don't want | ||
| // anything we call in the constructor to possibly prevent the constructor from running to completion. | ||
| var cancellationToken = this.CancellationToken; | ||
| _disconnectedSolutionTask = Task.Run(() => computeDisconnectedSolutionAsync(cancellationToken), cancellationToken); |
Contributor
Author
There was a problem hiding this comment.
this is to be hyper paranoid, but it is legitimately safer. Synchronously calling into a callback which runs abitrary code within this constructor is inherrently unsafe. If anything throws synchronously in that callback then this constructor won't finish, and the caller won't properly update cache state.
CyrusNajmabadi
commented
Aug 2, 2022
| // cache state in RemoteWorkspace must always run fully to completion without issue. We don't want | ||
| // anything we call in this method to possibly prevent the method from running to completion. | ||
| var cancellationToken = this.CancellationToken; | ||
| _primaryBranchTask = Task.Run(() => ComputePrimaryBranchAsync(cancellationToken), cancellationToken); |
Contributor
Author
There was a problem hiding this comment.
same issue. TryKickOffPrimaryBranchWork_NoLock must run to completion successfully.
dibarbet
approved these changes
Aug 2, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Followup to #63131