[Asterisk-code-review] media_cache: Don't lock when curl the remote file (asterisk[master])
Andre Barbosa
asteriskteam at digium.com
Tue Aug 17 15:36:52 CDT 2021
Attention is currently required from: Joshua Colp, Kevin Harwell.
Andre Barbosa has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16233 )
Change subject: media_cache: Don't lock when curl the remote file
......................................................................
Patch Set 3:
(2 comments)
File main/media_cache.c:
https://gerrit.asterisk.org/c/asterisk/+/16233/comment/6fe398b3_b0afd2c9
PS2, Line 210: bucket_file = ao2_find(media_cache, uri, OBJ_SEARCH_KEY | OBJ_NOLOCK);
> This logic doesn't appear to be correct. […]
You're right Joshua. Sorry for this, I got a bit confused and messed up.
Just pushed a new version to address your comments.
Basically using a new tmp_bucket_file pointer just to test if the file is already cached.
If it is, we just remove downloaded file, all refs and return.
If it doesn't exist, we just store the previously fetched bucket_file.
https://gerrit.asterisk.org/c/asterisk/+/16233/comment/bf4e40bd_8bd4d6b3
PS2, Line 212: ao2_ref(bucket_file, -1);
> As well when this logic is fixed - I believe you need to call ast_bucket_file_delete on what was ret […]
Just added that on the new patch.
Thanks for your comments.
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16233
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I8d4142b463ae4a1d4c41bff2bf63324821567408
Gerrit-Change-Number: 16233
Gerrit-PatchSet: 3
Gerrit-Owner: Andre Barbosa <andre.emanuel.barbosa at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Attention: Joshua Colp <jcolp at sangoma.com>
Gerrit-Attention: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Tue, 17 Aug 2021 20:36:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210817/766bc1ad/attachment.html>
More information about the asterisk-code-review
mailing list