[Home]

Summary:ASTERISK-23548: POST to ARI sometimes returns no body on success
Reporter:Scott Griepentrog (sgriepentrog)Labels:
Date Opened:2014-03-27 11:11:36Date Closed:2014-03-28 11:25:02
Priority:MajorRegression?No
Status:Closed/CompleteComponents:
Versions:12.0.0 Frequency of
Occurrence
Frequent
Related
Issues:
Environment:Ubuntu server 12.04 32bit running Asterisk 12 at rev 410918Attachments:( 0) create_bridge.js
( 1) DumpFile01.pcap
Description:When sending a POST to ARI using Node.js (chunked encoding), the response sometimes contains no body for operations that should return a json representation of the created resource even though the response code shows that the operation was a success.

Running a test Node.js script shows that this is intermittent. This happens on my system roughly 25% of the time I make a call to create a resource.

I have seen this issue when attempting to create a bridge or when calling play on a channel.
Comments:By: Scott Griepentrog (sgriepentrog) 2014-03-28 12:16:13.542-0500

Note for historical purposes:

Setting TCP_NODELAY on the socket also resolves this problem.  That indicates that the issue is clearly that close() is not (under very special circumstances) flushing the data in the output stream buffer prior to TCP FIN.  Although the shutdown() sequence was also added to manager which uses TCP_NODELAY, there is no negative side effects to leaving it there as well.