Windows: wait for processes started as user #348
Merged
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.
When running background maintenance from the service, we want to wait
for the process to finish to guarantee we do not have multiple
maintenance activities running at the same time. However, we have a
custom runner to launch the
scalar run
processes. This runner doesnot properly wait for the process to end, so we quickly launch all of
the maintenance activities at once. This can be particularly bad after
opening a laptop after a long sleep.
It is reasonable that we were not waiting before, because this is the
same way that we launch the Scalar.Service.UI executable, and we
cannot wait for that to close.
By adding a wait (only in the case of maintenance verbs), we will
actually ensure that only one maintenance activity runs at a time.
Resolves the root cause of #328.
For evidence that this changes how this works, here is how the old service would run several config steps at startup:
and here is the new service:
Notice that before, these steps all launched in about 1.0
seconds, but actually waiting for the processes to complete
takes 26 seconds.