Skip to content

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

Closed
Algosse wants to merge 5 commits intoOCA:17.0from
Algosse:17-imp-fs_storage-store_connection
Closed

[17.0][IMP] fs_storage: invalidate orm cache when connection fails#384
Algosse wants to merge 5 commits intoOCA:17.0from
Algosse:17-imp-fs_storage-store_connection

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).

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 16, 2025
@github-actions github-actions bot closed this Apr 20, 2025
@john-herholz-dt
Copy link
Contributor

@Algosse what is the state of this issue for you? I am facing the same problem. SFTP Connections fail after multiple files.
I have updated latest 17.0 branch but it was not resolved for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants