fix: improve response time on windows when using deadline config GUI #540
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.
What was the problem/requirement? (What/Why)
On Windows, there was a 10+ second hang whenever updating settings through the
deadline config gui
GUI whenapply
orOK
were clicked.This hang was caused by opening a subprocess to call
icacls
in order to set and read directory permissions.This lead to discovering that we were erroneously resetting the permissions on that directory on each config change.
What was the solution? (How)
We only need to set directory permissions when creating the directory, so add logic to detect if we are creating the directory.
Also switch to using the
win32security
module to set permissions instead of opening a subprocess that callsicacls
. This is faster and doesn't rely on interpreting the STDOUT of another process.What is the impact of this change?
The GUI is more responsive when applying or saving settings.
How was this change tested?
See DEVELOPMENT.md for information on running tests.
Yes
Yes
download
orasset_sync
modules? If so, then it is highly recommendedthat you ensure that the docker-based unit tests pass.
No
I also tested manually by comparing the response time when using the config GUI before and after this change.
Apply
before the GUI could be interacted with again.apply
to another GUI element)For the permissions change, I added unit tests, and also manually tested by:
~/.deadline
folder, and runningdeadline config gui
to initialize the directory + the config file.SYSTEM
account, domain Administrators, and my logged in usernamedeadline config gui
.Was this change documented?
Does this PR introduce new dependencies?
This library is designed to be integrated into third-party applications that have bespoke and customized deployment environments. Adding dependencies will increase the chance of library version conflicts and incompatabilities. Please evaluate the addition of new dependencies. See the Dependencies section of DEVELOPMENT.md for more details.
Is this a breaking change?
This change is not a breaking change
Does this change impact security?
Yes-ish.
It modifies a part of the code where we set file permissions, and removes the part where we always overwrite existing file permissions.
The actual permissions which are set have not been changed. I manually validated this by creating the directory through
deadline config gui
, and confirming that the permission on the folder where identical upon first creation both before and with this change.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.