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

[18.0][FIX] fs_storage: fix _ls_check_connection when dealing with huge amount of files in root folder #453

Open
wants to merge 1 commit into
base: 18.0
Choose a base branch
from

Conversation

sebalix
Copy link
Contributor

@sebalix sebalix commented Mar 4, 2025

Context

We tried to configure a storage on an AzureBlobFileSystem with 3.8+M of files located at the root directory.

Issue

This storage is in read-only access, so we have to use the other option ls to check the connection. Issue is that the current ls on root folder will try to return too much file names, increasing the consumed memory, leading to a kill of the Odoo process.

Proposed solution

Perform this ls on a non-existing file, which should then raise FileNotFoundError (to check if this exception is returned by all protocols?). If nothing is raised, that also means the connection is working (as before).

@@ -21,6 +21,8 @@

_logger = logging.getLogger(__name__)

LS_NON_EXISTING_FILE = ".NON_EXISTING_FILE"
Copy link
Contributor Author

@sebalix sebalix Mar 4, 2025

Choose a reason for hiding this comment

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

Should it be a new config field? Should we add some random characters when using it to ensure it is non-existing on remote FS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(even if the file exists, as soon as ls returns we are good)

@sebalix sebalix force-pushed the 18-fix-fs_storage branch from 0972547 to d510be3 Compare March 4, 2025 14:34
@sebalix sebalix force-pushed the 18-fix-fs_storage branch from d510be3 to 84a4755 Compare March 4, 2025 14:38
@sebalix sebalix marked this pull request as ready for review March 4, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants