[Home]

Summary:ASTERISK-23204: Device state cache requires improvement
Reporter:Mark Michelson (mmichelson)Labels:
Date Opened:2014-01-28 16:24:43.000-0600Date Closed:2014-03-07 14:42:52.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Core/Stasis
Versions:12.0.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:
Description:Device state caching is performed in such a way that it has two major problems:

1) A single device results in multiple device state cache entries. This means that in order to find what the "true" device state is, the entire device state cache has to be traversed to aggregate the total state of a device for every device state update.
2) The traversal and aggregation of the device state cache happens in a separate thread from the publisher, meaning that an understanding of how stasis caching works is violated.

It would be best if this could be fixed so that even if there are multiple external identically named devices, they all fall under one cache entry in the device state cache and the cache entry were updated at the time of device state publication.
Comments:By: Richard Mudgett (rmudgett) 2014-03-07 14:42:40.582-0600

Author: rmudgett
Date: Fri Mar  7 14:41:13 2014
New Revision: 410185

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=410185
Log:
stasis cache: Enhance to keep track of an item from different entities.

A stasis cache entry now contains more than a single message/snapshot.  It
contains messages/snapshots for the local entity as well as any remote
entities that post to the cached item.  In addition callbacks can be
supplied when the cache is created to compute and post the aggregate
message/snapshot representing all entities stored in the cache entry.

* All stasis messages now have an eid to indicate what entity posted it.

* The stasis cache enhancements allow device state to cache and aggregate
the device states from local and remote entities in a single operation.
The cached aggregate device state is available immediately after it is
posted to the stasis bus.  This improves performance by eliminating a
cache dump and associated ao2 container traversals to calculate the
aggregate state.

(closes issue ASTERISK-23204)
Reported by: Mark Michelson

Review: https://reviewboard.asterisk.org/r/3281/
........

Merged revisions 410184 from http://svn.asterisk.org/svn/asterisk/branches/12