[Asterisk-code-review] stasis: Segment channel snapshot to reduce creation cost. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Tue Nov 13 06:38:42 CST 2018


Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/10622 )

Change subject: stasis: Segment channel snapshot to reduce creation cost.
......................................................................


Patch Set 1: Code-Review-1

(5 comments)

The -1 is for my pbx_realtime.c comments only.  Feel free to take action or not for my other comments.

https://gerrit.asterisk.org/#/c/10622/1/main/channel_internal_api.c
File main/channel_internal_api.c:

https://gerrit.asterisk.org/#/c/10622/1/main/channel_internal_api.c@233
PS1, Line 233: #define DEFINE_STRINGFIELD_SETTERS_FOR(field, publish, assert_on_null) \
All callers now use publish = 0, assert_on_null = 0.  I could see assert_on_null possibly being useful for future setters but publish without invalidate seems useless.


https://gerrit.asterisk.org/#/c/10622/1/main/stasis_channels.c
File main/stasis_channels.c:

https://gerrit.asterisk.org/#/c/10622/1/main/stasis_channels.c@461
PS1, Line 461: 	snapshot = ao2_alloc_options(sizeof(*snapshot), channel_snapshot_dtor,
Could we have a situation where we could just bump/return the old snapshot?  That is no segments invalidated, no ari/manager vars, state/amaflags/flags/softhangup_flags unchanged?


https://gerrit.asterisk.org/#/c/10622/1/main/stasis_channels.c@556
PS1, Line 556: 	/* These have to be recreated as they may have changed, unfortunately */
Seems like these functions immediately return NULL if no vars are configured?  Should we add a comment to the sample manager.conf and ari.conf stating that the associated options can be costly?


https://gerrit.asterisk.org/#/c/10622/1/pbx/pbx_realtime.c
File pbx/pbx_realtime.c:

https://gerrit.asterisk.org/#/c/10622/1/pbx/pbx_realtime.c@351
PS1, Line 351: 					/* pbx_exec sets application name and data, but we don't want to log
Creating/publishing the snapshot from here makes no sense to me.  From what I can tell pbx_exec will still publish a snapshot with updated app/data.


https://gerrit.asterisk.org/#/c/10622/1/pbx/pbx_realtime.c@354
PS1, Line 354: 					ast_string_field_set(snapshot->dialplan, appl, app);
This violates existing snapshot->dialplan immutability unless AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN was set during the call to ast_channel_snapshot_create.



-- 
To view, visit https://gerrit.asterisk.org/10622
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5d7ef3df963a88ac47bc187d73c5225c315f8423
Gerrit-Change-Number: 10622
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Comment-Date: Tue, 13 Nov 2018 12:38:42 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181113/5601ab54/attachment-0001.html>


More information about the asterisk-code-review mailing list