Skip to content

Lazy connect to federated share, not in storage constructor#29275

Merged
DeepDiver1975 merged 1 commit into
masterfrom
lazy-init-fedstorage
Oct 19, 2017
Merged

Lazy connect to federated share, not in storage constructor#29275
DeepDiver1975 merged 1 commit into
masterfrom
lazy-init-fedstorage

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

Description

Don't connect directly to the remote share inside the storage
constructor. Defer this to the lazy initialization routine, which will
then correctly configure the remote root using the discovery manager.

Related Issue

Ref #28763 (comment)

Motivation and Context

To avoid having to wait for time outs for not yet memcached federated share connections. This could slow down upgrade processes because setting up FS calls the constructor of storages.
Also would improve performance when no memcache is configured when setting up FS for operations not relevant to the federated share, where it would previously still construct the storage and trigger a network connection.

How Has This Been Tested?

I just retested that federated shares still work, unit test also works.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov

codecov Bot commented Oct 18, 2017

Copy link
Copy Markdown

Codecov Report

Merging #29275 into master will increase coverage by 0.03%.
The diff coverage is 93.75%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #29275      +/-   ##
============================================
+ Coverage     59.56%   59.59%   +0.03%     
- Complexity    17156    17162       +6     
============================================
  Files          1029     1029              
  Lines         57211    57222      +11     
============================================
+ Hits          34076    34100      +24     
+ Misses        23135    23122      -13
Impacted Files Coverage Δ Complexity Δ
lib/private/Files/Storage/DAV.php 11.05% <100%> (+3.29%) 161 <6> (ø) ⬇️
apps/files_sharing/lib/External/Storage.php 28.57% <93.33%> (+5.62%) 49 <6> (+6) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6b7738...8e3bece. Read the comment docs.

@jvillafanez jvillafanez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can't find a better way to do this at this moment.

Don't connect directly to the remote share inside the storage
constructor. Defer this to the lazy initialization routine, which will
then correctly configure the remote root using the discovery manager.
@PVince81 PVince81 force-pushed the lazy-init-fedstorage branch from b5ab7c6 to 8e3bece Compare October 18, 2017 12:31
@DeepDiver1975 DeepDiver1975 merged commit f7243bb into master Oct 19, 2017
@DeepDiver1975 DeepDiver1975 deleted the lazy-init-fedstorage branch October 19, 2017 17:36
@DeepDiver1975

Copy link
Copy Markdown
Member

backport? @PVince81

@PVince81

Copy link
Copy Markdown
Contributor Author

stable10: #29314

@lock

lock Bot commented Aug 2, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants