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

[stable9.1] Fix sharedstorage recursion hell #25789

Merged
merged 4 commits into from
Aug 16, 2016

Conversation

PVince81
Copy link
Contributor

Fixes #25557

Obsoletes #25754 which was branched off v9.1.0 and was missing other sharing fixes that went into stable9.1

@owncloud/sharing @owncloud/filesystem

@SergioBertolinSG can you retest with 1000 users on this PR ?

@PVince81 PVince81 force-pushed the stable9.1-usermountcache-hell-shortcutstorageid branch from a045392 to 837bf1c Compare August 15, 2016 09:09
@PVince81
Copy link
Contributor Author

Rebased for CI.

Please review @owncloud/sharing @owncloud/filesystem @DeepDiver1975 @VicDeo @jvillafanez

@PVince81 PVince81 changed the title Fix sharedstorage recursion hell [stable9.1] Fix sharedstorage recursion hell Aug 15, 2016
@@ -1684,6 +1686,11 @@ public function getPath($id) {
/**
* @var \OC\Files\Mount\MountPoint $mount
*/
if (!$includeShares && $mount instanceof SharedMount) {
Copy link
Member

Choose a reason for hiding this comment

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

Under what circumstances do we want to include the shares? Maybe we should specify when we can include the shares to make things clear, taking into account there is an infinite loop lurking. Otherwise, we should remove the flag and never instantiate shared storages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are probably a few use cases I don't know of which would expect shares to be available.
One for example is the permalink: if you open a permalink where the fileid is on a shared storage, then the getPath method needs to be able to resolve it to the original storage by this mean.

Basically, I have the feeling that the only moment we need the shared mounts to be present here is for the current user, but not when recursing.

I chose the current somewhat hacking approach to avoid breaking other things.

@jvillafanez
Copy link
Member

Other than my comment, code looks good (not tested) 👍

@SergioBertolinSG
Copy link
Contributor

I've tested this with 1000 users, all of them belonging to same group, sharing every user a folder with a different name with the group.

There are no errors in the logs.

But when logging with any user it takes a lot of time to login (excessive), and forever to load the files view.

@PVince81
Copy link
Contributor Author

I don't think I can easily reduce the time it takes for login here. But the most important is that the recursion is gone because it would cause crashes.

@PVince81
Copy link
Contributor Author

@SergioBertolinSG did you have XDebug enabled in your test ? If yes then it's good news and likely that the recursion is indeed gone.

@SergioBertolinSG
Copy link
Contributor

No, it is not enabled.

@SergioBertolinSG
Copy link
Contributor

Using same folder name for all users, no problems found. No errors in logs. The performance problem in login and files view I guess it would be the same. This went quicker because I stopped the script before.
👍

@PVince81
Copy link
Contributor Author

I also ran smashbox against this branch and no errors were found.

Merging.

@PVince81 PVince81 merged commit 4b9879d into stable9.1 Aug 16, 2016
@PVince81 PVince81 deleted the stable9.1-usermountcache-hell-shortcutstorageid branch August 16, 2016 11:40
@todestoast
Copy link

I did a short test and it seems like this also fixed #25884 (Memory issues on command line rescans via occ).

@PVince81
Copy link
Contributor Author

@todestoast thanks for testing. If you had shares on your system, it is likely that "occ files:scan" would also mount shared storages and triggered the recursion that this PR fixes. So yeah, good to hear it fixed that too!

@PVince81
Copy link
Contributor Author

I managed to isolate steps to reproduce this locally, we should add integration tests for these: #25557 (comment)

@PVince81
Copy link
Contributor Author

QA ticket for integration tests: owncloud/QA#350

@lock
Copy link

lock bot commented Aug 4, 2019

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 4, 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