Skip to content

fix(files): don't count the availability recheck TTL twice - #66982

Closed
silverkszlo wants to merge 1 commit into
masterfrom
fix/unavailability-check
Closed

silverkszlo wants to merge 1 commit into
masterfrom
fix/unavailability-check

Conversation

@silverkszlo

@silverkszlo silverkszlo commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

setUnavailable() stored last_checked = time() + delay, while shouldRecheck() waits a further RECHECK_TTL_SEC on top of that. A single failed request blocked a storage for 20 minutes instead of 10, and an auth failure for auth_availability_delay + 10 minutes instead of the configured delay. Only add the part of the delay that exceeds the TTL.

Mechanism:

-> a storage wrapped by OC\Files\Storage\Wrapper\Availability throws StorageNotAvailableException
--> setUnavailable() calls Storage\Cache::setAvailability(false, $delay), which stores last_checked = time() + $delay
---> shouldRecheck() then waits until time() - last_checked > RECHECK_TTL_SEC
----> The commit set $delay = RECHECK_TTL_SEC for every failure (and max(auth_availability_delay, TTL) for StorageAuthException)
-----> so the TTL is added on top of the stored delay.

Effect:

A single failed request on a federated share or external storage blocks the mount for 20 min instead of 10. Every file operation on it returns 503 in that window.
An auth failure (StorageAuthException) blocks for auth_availability_delay + 10 min: 40 min with the default 1800 s, where the docs say 30.
SMB throws StorageAuthException for connection errors as well, so a network drop on SMB also gets the 40 minutes.

Checklist

AI

  • The content of this PR was partly or fully generated using AI

Signed-off-by: silver <s.szmajduch@posteo.de>
Assisted-by: ClaudeCode:claude-opus-5-5
@silverkszlo
silverkszlo requested a review from a team as a code owner November 24, 2026 07:49
@silverkszlo silverkszlo added 3. to review Waiting for reviews AI assisted labels Nov 24, 2026
@silverkszlo
silverkszlo requested review from ArtificialOwl, come-nc and icewind1991 and a balanced review from Copilot and removed request for a team and Copilot November 24, 2026 07:49
@silverkszlo
silverkszlo requested a review from blizzz November 24, 2026 08:14
@ArtificialOwl

Copy link
Copy Markdown
Member

duplicate of #66783 :)

@silverkszlo

Copy link
Copy Markdown
Contributor Author

As this PR is a duplicate of #66783 , I have added a commit with the test there and am closing this PR here :)

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.

2 participants