I'm testing my C++ EMA TRCC application on Linux and periodically I get the following exception while posting (via OmmConsumer::submit) messages (PostMsg):
loggerMsg TimeStamp: 2019/03/01 04:19:50.731 ClientName: Consumer_1_1 Severity: Error Text: Internal Error. Failed to allocate RsslTunnelStreamBuffer in TunnelItem::submitSubItemMsg( RsslMsg* ). loggerMsgEnd
I use UserDispatch model and I suspect that due to periodical data rate spikes on my side I submit too many messages before OmmConsumer::dispatch call. I tried to increase (from 5000 to 10000) GuaranteedOutputBuffers configuration parameter but it didn't help. Is there any way to handle such memory issues?
If solicitAsck mode is used for posting it seems that API doesn't free internal buffers (for messages) until it receive appropriate ACK from server (or timeout). If the server is slow in sending ACKs or Internet connection is used (network delays are possible) this might cause the growth of already sent messages waiting for ACK.
When calling the submit method of the tunnel stream, this method gets a buffer from TunnelStreamRequest.guaranteeOutputBuffers, encodes the data to it, and puts the encoded buffer to an internal queue waiting to be dispatched by a dispatcher thread. The application needs to dispatch in order to send data to the network.
The dispatcher thread gets the encoded buffer from the queue, encodes it to the buffer from Channel.guaranteeOutputBuffers and then sends it to the network.
In summary, TunnelStreamRequest.guaranteeOutputBuffers is used by the ETA Value-Added Reactor, and the buffers are put into the internal queue. Channel.guaranteeOutputBuffers is used by the ETA library to send data to the network.
To get more information, we need to review the code or contact the development team for internal implementation. Therefore, please submit a case to the API support team via Contact Premium Support .
If you don't see this option, please contact your colleague who has RDC subscription to submit a case on your behalf.
I tried to workaround this issue by reducing (from default 15000ms down to 5ms) PostAckTimeout configuration parameter. I was expecting that API will generate NACK and additionally it will remove cached message that wait for aknowlegment from the server, but surprisingly the change of PostAckTimeout did do anything. It simply doesn't work, I didnt get any NACKs even with PostAckTimeout=5ms (which must be guaranteed NACKs for almost all posted messages on Internet connection).
For a tunnel stream, you also need to set guaranteedOutputBuffers of TunnelStreamRequest.
TunnelStreamRequest tsr; tsr.classOfService(cos).domainType(MMT_SYSTEM).name("Seikan").serviceName("DDS_TRCE"); tsr.guaranteedOutputBuffers(5000);
Thank you for response. I didn't notice that TunnelStreamRequest has such setting and I'll let you know if it help after testing. Could you please explain how these parameters are correlated (global GuaranteedOutputBuffers and individual per Tunnel stream GuaranteedOutputBuffers)?