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

[17.0][IMP] fs_storage: invalidate orm cache when connection fails #384

Open
wants to merge 5 commits into
base: 17.0
Choose a base branch
from

Conversation

Algosse
Copy link

@Algosse Algosse commented Jul 11, 2024

Fixes #374

I adapted a some parts of the code related to _check_connection from V16.0 (started in #320) and implemented it in V17.0.

Also, I added a check_connection everytime the fs is accessed to detected if it should be generated again or not.

@lmignon
Copy link
Contributor

lmignon commented Jul 15, 2024

Thank you @Algosse for all your hard work. I don't work with Odoo version 17. It is therefore difficult for me to give an in-depth review of the proposed changes. I will try to take the time to install a version 17 and understand the problem you are experiencing.

@sbidoul
Copy link
Member

sbidoul commented Oct 7, 2024

I have ported all missing commits from 16 to 17 in #397

@Algosse Could you check if that branch works for you?

@lmignon
Copy link
Contributor

lmignon commented Nov 10, 2024

@Algosse Is your fix still required with the last changes on 16.0?

@Algosse
Copy link
Author

Algosse commented Nov 13, 2024

Hello Guys,

Thanks for the forward of V16!

Sorry for the delay, I did not find the time to properly check and run the changes.

I'm not sure the forward will solve my issue. In my previous tests, I figured the problem was the ormcache of the get_fs_by_code method

If the connection fails, the method keeps returning the same faulty fs. It does not access the fs property so it does not triger the check_connection method.
That is why I updated the get_fs_by_code method so it performs a check everytime (I know it can be costly but it is the best way I found yet). To get the fs, this new method calls the old one, renamed into a private method _get_fs_by_code.

I don't have the time to look at it now, I will be able in a few weeks.

If someone wants to try, the "best" way I found to crash the connection was to use a fs_storage with SFTP protocol, linked it to a model (for example sale.order) and drag & drop multiple files at once in the chatter (I think Odoo tries to upload files in parallel and fsspec does not like it, at least for SFTP).

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.

3 participants