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

Do not remove federated share on CURLE errors, provide improved notification in UI and exception handling #38474

Merged
merged 1 commit into from
Apr 14, 2021

Conversation

mrow4a
Copy link
Contributor

@mrow4a mrow4a commented Mar 7, 2021

fixes:

problem:
currently (and without some sophisitcated implementation in the future) there is no clean way of deciding of state of federated share. Currently PROPFIND is send, and if 404 not found is returned, then availability of system by probing e.g. status.php endpoint is performed. If status check succeed, federated share is removed. However, customer with large federation setup reported that shares get falsely removed under certain conditions on the server (e.g. some maintenance).

usecase:

  • there are two servers, fed1 and fed2. fed1 gets unavailable, user in fed2 removes federated share that he shared with fed1. fed1 never receives share removal. now fed1 becomes available, provide proper notification and log exception in the logs
  • due to some maintenance work, server returns CURLE_COULDNT_CONNECT or CURLE_OPERATION_TIMEDOUT or NotFound. This indicated to fed share storage provider that it should "test remote". However, now for some reason all "status checks like status.php" succeed, and we should let the user in fed1 decide what to do with share, instead of blindly removing

to be done:

  • provide most basic notification
  • investigate further notifications
  • tests

@mrow4a mrow4a self-assigned this Mar 7, 2021
@update-docs
Copy link

update-docs bot commented Mar 7, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@mrow4a mrow4a changed the title [WIP] do not remove federated share on not found, provide notification in UI [WIP] do not remove federated share on stat failure, provide notification in UI Mar 8, 2021
@mrow4a mrow4a force-pushed the bugfix/do-not-remove-fed-shares-on-unknown-status branch from 3e526d9 to 974d7c7 Compare March 30, 2021 21:34
@mrow4a mrow4a changed the title [WIP] do not remove federated share on stat failure, provide notification in UI Do not remove federated share on not found, provide improved notification in UI and exception handling Mar 30, 2021
@mrow4a mrow4a force-pushed the bugfix/do-not-remove-fed-shares-on-unknown-status branch 2 times, most recently from b864e19 to 094cca9 Compare March 31, 2021 19:24
@mrow4a mrow4a requested review from jvillafanez and VicDeo and removed request for jvillafanez March 31, 2021 19:25
@jvillafanez
Copy link
Member

I'm more inclined to remove the auto-delete feature and let the users decide. As long as the error is properly notified to the users and they can remove the failing remote, it shouldn't be a problem.
There could be additional problems such as a temporary network problem, problems with your ISP, server temporary down... so auto-removing the remote share could be a wrong choice if the admins can recover the connection later.

@mrow4a
Copy link
Contributor Author

mrow4a commented Apr 6, 2021

@jvillafanez I also was inclined in this direction until I saw how sync clients is handling this. Not so good -> with auto-delete on auth-error [1] it just removes the share, and uploads its local files to the newly created local folder as replacement, however without auto-delete it goes in some very noisy internal server error loop. on not-found error [2] it tests remote , and only if that fails fed share is removed.

This is why I made sure to do "strict not-found check" to exclude all network related problems. I am however myself puzzled whether not to stop testing remote and in that case (when not found is returned) to just throw error to client and let user decide what to do with that. @VicDeo @jvillafanez thoughs?

[1] auth-error is rather clear signal share got removed, it is that this fed share token can no longer be found.
[2] not-found error to me it is not really clear signal as cannot really think of case when this is thrown

@jvillafanez
Copy link
Member

however without auto-delete it goes in some very noisy internal server error loop

I guess that's something we should investigate. Maybe the clients should implement an exponential backoff for the automatic retries, and reset the backoff on manual interaction.

I'm ok with the solution, but it seems we have a technical debt we'll have to clean at some point.

@mrow4a mrow4a force-pushed the bugfix/do-not-remove-fed-shares-on-unknown-status branch from 094cca9 to d772974 Compare April 8, 2021 19:34
@mrow4a
Copy link
Contributor Author

mrow4a commented Apr 8, 2021

@jvillafanez There is now extensive logging, and thus if issue happens again we will have better understanding of what happens. I think what has been done is sufficient.

@mrow4a mrow4a changed the title Do not remove federated share on not found, provide improved notification in UI and exception handling Do not remove federated share on curl errors, provide improved notification in UI and exception handling Apr 8, 2021
@mrow4a mrow4a changed the title Do not remove federated share on curl errors, provide improved notification in UI and exception handling Do not remove federated share on CURLE errors, provide improved notification in UI and exception handling Apr 8, 2021
@sonarcloud
Copy link

sonarcloud bot commented Apr 8, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@AlexAndBear
Copy link

@mrow4a LGTM, merge?

@mrow4a mrow4a merged commit 2237705 into master Apr 14, 2021
@delete-merged-branch delete-merged-branch bot deleted the bugfix/do-not-remove-fed-shares-on-unknown-status branch April 14, 2021 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants