[asterisk-bugs] [JIRA] (ASTERISK-24286) Race condition in PBX core can cause missed device state changes

Mark Michelson (JIRA) noreply at issues.asterisk.org
Fri Aug 29 14:08:29 CDT 2014


Mark Michelson created ASTERISK-24286:
-----------------------------------------

             Summary: Race condition in PBX core can cause missed device state changes
                 Key: ASTERISK-24286
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24286
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
            Reporter: Mark Michelson


When the PBX core is notified of a device state change, instead of using the device state that is provided in the Stasis message, it instead finds hints that contain the device, then aggregates states of each of the devices in that hint using ast_device_state(). When two state changes are sent rapidly, both changes may get cached before the publishing thread calls into the PBX core to notify it of the first of the two state changes. Since both changes have been cached already, it means that the state set by the first state change is essentially "lost" since calling ast_device_state() will grab the state set by the second state change. When the PBX core handles the first state change, it ends up telling extension state watchers the state set by the second state change. When the second state change is handled by the PBX core, it does nothing since the new state is the same as the state that was last sent to watchers.

The net result is not necessary erroneous because extension state watchers end up getting the correct final state communicated to them. Since most extension state watchers are interested in the final state, this likely will not cause issues for them. However, if there exist any extension state watchers that react to specific states occurring, and that state is the "lost" state, then this could be an issue.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list