Skip to content
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

Check Data Directories on Request, Not Startup #28760

Merged
merged 11 commits into from
Jun 11, 2020
Merged

Conversation

cailafinn
Copy link
Contributor

Description of work.

Changes the behaviour of the ConfigService so that data directories are checked when access is reqested, rather than on startup. The intention is to reduce the startup time of workbench when checking for network drives that may be very slow to access.

To test:

  1. Launch workbench
  2. Add some directories on network drives to the list of user data directories.
  3. Slow down the network connection somehow (utilities such as trickle might be useful)
  4. Relaunch workbench, it should start more quickly as it isn't waiting for connections on startup any more.

Refs #28499


Reviewer

Please comment on the following (full description):

Code Review
  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
Functional Tests
  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

@cailafinn cailafinn added Framework Issues and pull requests related to components in the Framework GUI Issues and pull requests specific to the Mantid Workbench GUI. ISIS Team: Diffraction Issue and pull requests managed by the Diffraction subteam at ISIS ISIS Team: Core Issue and pull requests managed by the Core subteam at ISIS labels Jun 1, 2020
@cailafinn cailafinn added this to the Release 5.1 S3 milestone Jun 1, 2020
@martyngigg martyngigg self-assigned this Jun 1, 2020
@cailafinn cailafinn force-pushed the startup-directory-checks branch 8 times, most recently from ab55571 to 3da6c13 Compare June 4, 2020 12:32
martyngigg
martyngigg previously approved these changes Jun 4, 2020
Copy link
Member

@martyngigg martyngigg left a comment

Choose a reason for hiding this comment

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

Confirmed using wondershaper to slow connection to 10kb/s down and up. Adding a relative path to a network drive to the datasearch directories caused

from mantid.kernel import ConfigService
ConfigService.Instance()

to slow down from ~0.4s to ~1.5s.

With these changes the startup time of ConfigService is now independent of the directories present.

@NickDraper
Copy link
Contributor

@ConorMFinn Lots of build failures here, can you take a look

@martyngigg
Copy link
Member

@ConorMFinn Just one more failing test on Windows now.

@cailafinn cailafinn force-pushed the startup-directory-checks branch 2 times, most recently from 58353f0 to 1dcde7f Compare June 9, 2020 15:02
martyngigg and others added 6 commits June 10, 2020 13:39
It's a legacy key that is no longer in active use.
If the key contains the string "director" it is assumed to point
to a directory and if it its value is relatiove then the path
is converted to an absolute path. This reduces the workload on
startup while keeping the caching of important keys
such as the datasearch paths and instrument directories for performance.
Refs #12425
Config service now converts to an absolute path when storing values.
Tests needed some changes to account for this.

RE #28499
A lot of the ILL tests were using the appendDataSearchSubDir method in
the setup functions. This was resulting in many directories being added
to the config service as the tests ran. They have now been moved to the
setUpClass functions or constructors so they are only added once.

RE #28499
The changes to the ConfigService means that it can hold invalid paths
until they are requested. This means that a check needed adding to
ensure a path was valid before doing anything with it.

RE #28499
@gvardany gvardany merged commit b047060 into master Jun 11, 2020
@gvardany gvardany deleted the startup-directory-checks branch June 11, 2020 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues and pull requests related to components in the Framework GUI Issues and pull requests specific to the Mantid Workbench GUI. ISIS Team: Core Issue and pull requests managed by the Core subteam at ISIS ISIS Team: Diffraction Issue and pull requests managed by the Diffraction subteam at ISIS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants