-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Refresh PATH in configuration remoting server #5511
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
base: master
Are you sure you want to change the base?
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please confirm that the server process exits cleanly when the client completes.
/// </summary> | ||
public static void UpdatePath() | ||
{ | ||
List<string> paths = new List<string>(Environment.GetEnvironmentVariable(PathEnvironmentVariable)?.Split(';') ?? Array.Empty<string>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a HashSet<string>
to make the looped Contains
calls in AddPathsIfNotExist
more efficient?
{ | ||
if (!currentPaths.Contains(path)) | ||
{ | ||
currentPaths.Add(path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This always adds to the end, making it the last location to look. That may cause issues in some corner case; probably ok for now but maybe add a comment.
The "proper" thing to do would probably be to calculate the full new list of paths (what one would expect to get from a new process launch) and use a line merge algorithm with a strategy that puts the ephemeral entries before the new permanent ones. But that is a fair bit more complicated and could wait until later.
I can confirm ConfigurationRemotingServer.exe exits right after configuration completes. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Added a hidden window to listen for UserPreferenceChanged event (WM_SETTINGCHANGE) and update the process's PATH if needed.
Manually validated by running a configuration file with multiple resources, change the env var during the run, and verified in logs file that new path got included in runs after the change.
Microsoft Reviewers: Open in CodeFlow