[asterisk-app-dev] channel origination race condition discussion

Paul Belanger paul.belanger at polybeacon.com
Thu Dec 5 13:50:28 CST 2013


On Thu, Dec 5, 2013 at 1:26 PM, David M. Lee <dlee at digium.com> wrote:
>
> On Dec 4, 2013, at 4:12 PM, Matt DiMeo <mdimeo at digium.com> wrote:
>
>> Regarding the "Originate/Channel Creation as a two step proces" thread:
>>>> Another option would be to allow the user to specify the unique id of the
>>>> channel. This seems a bit frightening, but might be worth pursuing.
>>
>> I kinda like this idea too, if I could ask asterisk to allocate me a valid channel id I could then use with an originate.
>
> Functionally, this is very similar to the two-step origination process.
>
>> I've had a similar worry with PlaybackStopped.  In that case I wored around the race condition by doing a GET on the playbackID as soon as I get one back, and then treating a failed GET as a stopped playback.
>>
>> This is all another reason I hate having requests and events going through different pipes.  If I could send the request down the websocket, and asterisk promised to give me the channel id response on the websocket before sending me any events about it, there'd be no race condition.  But I guess that ship has sailed.
>
> We could do something similar to SwaggerSocket[1] to synchronize all communication over a single connection. Then responses and events would be serialized, avoiding the reordering issue.
>
> That has its own problems, though. AMI works in a very similar manner (events and action/response multiplexed on the same socket). As with most things, there are tradeoffs. When the system starts to see high loads, the increased latency having responses interleaved with events starts to cause problems.
>
>  [1]: https://github.com/wordnik/swaggersocket/wiki/SwaggerSocket-Protocol
>
Hmm, not a fan of depending on swagger, however, I haven't really
looked to see what else there is.

> --
> David M. Lee
> Digium, Inc. | Software Developer
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
> Check us out at:  www.digium.com  & www.asterisk.org
>
>
> _______________________________________________
> asterisk-app-dev mailing list
> asterisk-app-dev at lists.digium.com
> http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev



-- 
Paul Belanger | PolyBeacon, Inc.
Jabber: paul.belanger at polybeacon.com | IRC: pabelanger (Freenode)
Github: https://github.com/pabelanger | Twitter: https://twitter.com/pabelanger



More information about the asterisk-app-dev mailing list