Skip to content

[17.0][IMP] fs_attachment_s3: Optimize clean up storages using mass deletion#599

Merged
OCA-git-bot merged 3 commits into
OCA:17.0from
APSL:17.0-imp-fs_attachment_s3
Jul 15, 2026
Merged

[17.0][IMP] fs_attachment_s3: Optimize clean up storages using mass deletion#599
OCA-git-bot merged 3 commits into
OCA:17.0from
APSL:17.0-imp-fs_attachment_s3

Conversation

@peluko00

@peluko00 peluko00 commented Apr 28, 2026

Copy link
Copy Markdown

Optimize clean up storages using mass deletion with S3
cc https://github.com/APSL 38655
@mpascuall @BernatObrador @ppyczko @shirashi3771 @palomagrc93 @miquelalzanillas @LlucSG please review

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @lmignon,
some modules you are maintaining are being modified, check this out!

@peluko00
peluko00 force-pushed the 17.0-imp-fs_attachment_s3 branch 3 times, most recently from a596bc5 to b858c7d Compare April 29, 2026 07:36
Comment thread fs_attachment_s3/readme/CONTRIBUTORS.md Outdated
Comment on lines +3 to +4
- [APSL-Nagarro](https://apsl.tech):
- Antoni Marroig \<<amarroig@apsl.net>\>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would be nice to follow the same pattern as for others contributors ;-)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done!

@lmignon lmignon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for your contribution @peluko00 The code looks good to me.

@peluko00
peluko00 force-pushed the 17.0-imp-fs_attachment_s3 branch from b858c7d to 964ac2f Compare May 11, 2026 08:36

@lbarry-apsl lbarry-apsl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code reviewed. LGTM

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@peluko00

Copy link
Copy Markdown
Author

Seems it's ready for merge @lmignon ?

Comment thread fs_attachment_s3/models/fs_file_gc.py Outdated
"GC: Sending bulk delete request to S3 (%s files)",
len(objects_to_delete),
)
s3_client.delete_objects(

@lmignon lmignon Jun 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here you call an async IO method outside a coroutine. That's mean that the method will never be awaited and then execute....

        fsspec.asyn.sync(
            fsspec.asyn.get_loop(),
            s3_client.delete_objects,
            Bucket=bucket_name,
            Delete={"Objects": objects_to_delete},
        )

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done, could you review again please?

@lmignon

lmignon commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

@peluko00 see fa66325

@peluko00
peluko00 force-pushed the 17.0-imp-fs_attachment_s3 branch from 964ac2f to 51cfad6 Compare June 25, 2026 05:44
@peluko00
peluko00 requested a review from lmignon June 25, 2026 05:48
@peluko00

peluko00 commented Jul 9, 2026

Copy link
Copy Markdown
Author

@peluko00 see fa66325

It's the same code as here right?

@lmignon

lmignon commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@peluko00 Why do you copy paste my code in your changes? A cherry -pick would have preserved the authorship as I did it on the 16.0 branch with your commit. It will also makes conflicts on back/fw port from/to 16.0

s3fs uses aiobotocore as s3 client, which is asynchronous, but Odoo does
not support async calls, therefore the call to delete objects from S3 was
not working. The fsspec library provides a way to run async calls in a
synchronous way. The fsspec.asyn.sync function is now used to run the async
call to delete objects from S3, in a synchronous way, in order to make it
work in Odoo.
@peluko00
peluko00 force-pushed the 17.0-imp-fs_attachment_s3 branch from cd1a31e to 0ccc238 Compare July 15, 2026 07:31
@peluko00

Copy link
Copy Markdown
Author

@peluko00 Why do you copy paste my code in your changes? A cherry -pick would have preserved the authorship as I did it on the 16.0 branch with your commit. It will also makes conflicts on back/fw port from/to 16.0

Sorry about that, now cherry-pick is done!

@peluko00

Copy link
Copy Markdown
Author

Could you merge please @lmignon ?

@lmignon

lmignon commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

/ocabot merge minor

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 17.0-ocabot-merge-pr-599-by-lmignon-bump-minor, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit cd04d34 into OCA:17.0 Jul 15, 2026
5 of 7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at d559e1b. Thanks a lot for contributing to OCA. ❤️

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