Repository navigation
Conversation
|
By analyzing the blame information on this pull request, we identified @rullzer, @blizzz and @icewind1991 to be potential reviewers |
|
@rullzer @icewind1991 please comment as this can have impact on the FS and also avatar logic |
|
hmmm ... I understand the intention of the fix - but it looks like this is tearing down too much of the fs logic. Looks like we need call teardown explicitly for the users after accessing the avatar images. Maybe we even can get rid of initializing the filesystem for each user? |
|
hm ... the CardDav SyncJob is executed daily. When it runs out of memory, the job will be executed with the next cron job ... probably blocking other jobs ... and what not ... |
| * Basically we do not want to copy the skeleton folder | ||
| */ | ||
| \OC\Files\Filesystem::tearDown(); | ||
| \OC\Files\Filesystem::initMountPoints($userId); |
There was a problem hiding this comment.
if you do a teardown you need to follow it up by a full setup instead of only adding the mounts for a user
| /* | ||
| * Resetup FS to free memory of old storage wrappers | ||
| */ | ||
| \OC_Util::tearDownFS(); |
There was a problem hiding this comment.
I don't think we can use setupFS here. I remember that @rullzer explicitly had to avoid setupFS due to other problems and had to resort to use initMountPoints only, which is a sub-operation of setupFS
There was a problem hiding this comment.
There was a problem hiding this comment.
do we need a tearDownMountPoints($user) ?
There was a problem hiding this comment.
@rullzer tried to avoid the skeleton creation which is triggered when using \OC::$server->getUserFolder($userId); I don't see where setupFS triggers the user skeleton generation.
There was a problem hiding this comment.
waiting for smashbox? the rest is green. ..
There was a problem hiding this comment.
There was a problem hiding this comment.
@butonic $userId is not guaranteed to be the currently logged in user. There are cases where you are logged in as user A but request the avatar of user B.
There was a problem hiding this comment.
Yuck ... well ... hmmm ... but requesting an avatar image hopefully only happens when requesting it via ajax. And in this from job ... in any case, this is only a proposed workaround. We shoul focus on solving this correctly and store the avatars in a user agnostic storage that does not require doing a user specific filesystem setup. See linked issue above.
There was a problem hiding this comment.
hopefully
Experience tells that we're usually unlucky on that side...
Even when requesting over ajax, the currently logged in user might still not be the one from the avatar that is fetched, for example in the share dropdown or in the users page. Last time we touched this code it was because the users page was auto-creating the skeleton files while listing the users, due to avatar fetching. This means that the users page already fetches avatars for a user who is not the same as the avatar (the fetching user being admin).
There was a problem hiding this comment.
I agree to focus on moving the avatars to a better location, however such change will not be backportable. So depending on the goal for the fix, we might or might not want to continue finding a backportable fix in the meantime.
|
Moving this quickfix to 9.0.5. |
|
....proper solution being the one that changes the location of avatars permanently, which won't be backportable. |
|
Further ideas:
|
|
I'll have a try with the second approach. |
|
Argh, nooooo... we can't tear down that user's FS because the |
|
Even worse: I just noticed while testing something that That FS part could really use a good redesign and rewrite... |
|
Oh, looks like there's /me bangs head against the wall |
|
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. |
With a lot of users the carddav SyncJob will run out of memory because it fetches an avatar, causing the filesystem for every user to be initialized.
The workaround introduced to not create the skeleton when fetching an avatar can be further uglified by tearing down the filesystem so that all old storage wrappers are cleaned up. I did not want to tear down the filesystem in a different place to minimize the impact on other code paths.
@PVince81 @DeepDiver1975 @icewind1991 can you comment if the approach makes sense until we find a better solution as tracked in #22414?
This is how memory developed before this PR:
This is after the patch:
While there is still a memory increase the whole encryption wrapper and filesystem mounts stuff is now freed. There are three classes still growing:
When these three use a capped cache the biggest loosers are removed.