Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
b793f8cc
Commit
b793f8cc
authored
6 years ago
by
Joshua Colp
Committed by
Gerrit Code Review
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge "stasis_cache: Stop caching stasis subscription change messages"
parents
b13f0690
5ec6d2c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main/stasis_cache.c
+9
-22
9 additions, 22 deletions
main/stasis_cache.c
with
9 additions
and
22 deletions
main/stasis_cache.c
+
9
−
22
View file @
b793f8cc
...
...
@@ -817,29 +817,16 @@ static void caching_topic_exec(void *data, struct stasis_subscription *sub,
msg_type
=
stasis_message_type
(
message
);
/*
* app_voicemail used to rely on the cache containing every topic subscribe and
* unsubscribe in order to determine if anyone was currently subscribed to a
* particular mailbox. This caused the cache to grow unabated for the life of
* the asterisk instance. Since it no longer needs the cache of these message
* types, and no other function needs them, we no longer cache them.
*/
if
(
stasis_subscription_change_type
()
==
msg_type
)
{
struct
stasis_subscription_change
*
change
=
stasis_message_data
(
message
);
/*
* If this change type is an unsubscribe, we need to find the original
* subscribe and remove it from the cache otherwise the cache will
* continue to grow unabated.
*/
if
(
strcmp
(
change
->
description
,
"Unsubscribe"
)
==
0
)
{
struct
stasis_cache_entry
*
sub
;
ao2_wrlock
(
caching_topic
->
cache
->
entries
);
sub
=
cache_find
(
caching_topic
->
cache
->
entries
,
stasis_subscription_change_type
(),
change
->
uniqueid
);
if
(
sub
)
{
cache_remove
(
caching_topic
->
cache
->
entries
,
sub
,
stasis_message_eid
(
message
));
ao2_cleanup
(
sub
);
}
ao2_unlock
(
caching_topic
->
cache
->
entries
);
ao2_cleanup
(
caching_topic_needs_unref
);
return
;
}
msg_put
=
message
;
msg
=
message
;
ao2_cleanup
(
caching_topic_needs_unref
);
return
;
}
else
if
(
stasis_cache_clear_type
()
==
msg_type
)
{
/* Cache clear event. */
msg_put
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment