Skip to content

Add the storage id to the mount config - #12793

Merged
RobinMcCorkell merged 1 commit into
masterfrom
mountconfig-store-id
Dec 17, 2014
Merged

RobinMcCorkell merged 1 commit into
masterfrom
mountconfig-store-id

Conversation

@icewind1991

Copy link
Copy Markdown
Contributor

First step into improving the config is making sure we have a stable id to work with.

cc @DeepDiver1975 @PVince81

@icewind1991

Copy link
Copy Markdown
Contributor Author

@PVince81

Copy link
Copy Markdown
Contributor

Also @Xenopathic, something to cheer up about 😄

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like we're writing the config file for every setup/file access ?
I could imagine cases with concurrency issue when multiple HTTP calls are calling setupFS() which will call initMountPointsHook() and write this config at the same time... who knows in what state the file will be ?

Maybe it would be better to first check whether there's an id in the config. If none was found, then write it.
But don't write it every time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Switched it to only writing back the config file if we added the id

@ghost

ghost commented Dec 11, 2014

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/4342/

Build result: FAILURE

[...truncated 17 lines...]using GIT_SSH to set credentials using .gitcredentials to set credentials > git config --local credential.helper store --file=/tmp/git7601646795952828275.credentials # timeout=10 > git fetch --tags --progress https://github.com/owncloud/core.git +refs/pull/:refs/remotes/origin/pr/ > git config --local --remove-section credential # timeout=10 > git rev-parse origin/pr/12793/merge^{commit} # timeout=10 > git branch -a --contains 3acdcf065a88be0239d4ca10797b58c2d26cd3e7 # timeout=10 > git rev-parse remotes/origin/pr/12793/merge^{commit} # timeout=10Checking out Revision 3acdcf065a88be0239d4ca10797b58c2d26cd3e7 (origin/pr/12793/merge) > git config core.sparsecheckout # timeout=10 > git checkout -f 3acdcf065a88be0239d4ca10797b58c2d26cd3e7 > git rev-list 0d8587d0f6192941fc30f077b72d1be19557a78c # timeout=10First time build. Skipping changelog. > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule update --init --recursiveTriggering pull-request-analyser-ng-simple » SLAVEpull-request-analyser-ng-simple » SLAVE completed with result FAILUREStarted calculate disk usage of buildFinished Calculation of disk usage of build in 0 secondsStarted calculate disk usage of workspaceFinished Calculation of disk usage of workspace in 1 second
💣 Test FAILed. 💣

@PVince81

Copy link
Copy Markdown
Contributor

Can you try and add a unit test in "tests/mountconfig.php" ?

@PVince81

Copy link
Copy Markdown
Contributor

I guess there is nothing we can do here to avoid "mount.json" to be read twice ? (once in the MountProvider/etc stack and once here)

@PVince81

Copy link
Copy Markdown
Contributor

Hmm, how about doing this storage id check+storing inside of getAbsoluteMountPoints() ? (which is called by ConfigAdapter. There is already a readData() there.

@PVince81

Copy link
Copy Markdown
Contributor

I just tried creating new mount points (or renaming, or changing the settings), but they do always automatically receive a numeric id. Often I need to access them first for them to get an id.

Would it be possible to give them a number right away ?

Here are some steps for one of the issues:

  1. Create new system-wide sftp storage to mount point "/sftp"
  2. Check "mount.json": no id set
  3. Access storage in files view
  4. Check "mount.json": storage_id appears
  5. Rename "/sftp" to "/sftp_renamed"
  6. Check "mount.json": storage_id appears, rename worked
  7. Change applicable to "user1" and "user2"
  8. Check "mount.json": storage_id appears for both user entries
  9. Rename "/sftp_renamed" to "/sftp_again"
  10. Check "mount.json": storage_id appears only for "user1" but is missing for "user2"
  11. Change the "root" field
  12. Check "mount.json": storage_id changes, which is correct (but still missing for "user2")
  • BUG: set storage_id for all users, not only the first one

@icewind1991

Copy link
Copy Markdown
Contributor Author

Switched to adding the storage_id on every write

@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 4 new issues, 3 updated code elements

@ghost

ghost commented Dec 17, 2014

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/4771/
🚀 Test PASSed. 🚀

@PVince81

Copy link
Copy Markdown
Contributor

Works properly now, thanks! 👍

@PVince81

Copy link
Copy Markdown
Contributor

@Xenopathic @DeepDiver1975 second reviewer ?

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

Looks good 👍

RobinMcCorkell pushed a commit that referenced this pull request Dec 17, 2014
Add the storage id to the mount config
@RobinMcCorkell
RobinMcCorkell merged commit c20be24 into master Dec 17, 2014
@RobinMcCorkell
RobinMcCorkell deleted the mountconfig-store-id branch December 17, 2014 17:53
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 15, 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.

5 participants