Problem:
Product: VisiBroker
Version: 7 and newer
Platform: All
Both the Client and Server processes appear hung. The C Server process has the following stack:
at 0xd2488cf0 VISTCPConnBase::_read(unsigned char,unsigned char,char*,unsigned long,unsigned long,unsigned long long)(0x209d6c7c, 0x1000001, 0x20842340, 0xf528d904, 0x206d5028, 0x0, 0x206f0de0, 0xf528d904)
at 0xd249b96c VISTCPConnBase::_read(unsigned char,unsigned char,char*,unsigned long,unsigned long,unsigned long long)(0x209d6c68, 0x1000001, 0x1000001, 0x2095a908, 0x0, 0xc,0x0, 0x0)
at 0xd249b96c VISTCPConnBase::read(unsigned char,unsigned char,char*,unsigned long,unsigned long,unsigned long long)(0x209d6c68, 0x1000001, 0x1000001, 0x2095a908, 0x0, 0xc, 0x0, 0x0)
at 0xd249b7dc VISGIOPInputBuffer::read_from_connection(ProtocolEngine::Connection*,unsigned long,unsigned long,unsigned long long)(0x206d5648, 0x209d6ce0, 0x0, 0xc, 0x0, 0x0) at 0xd23d3e30
VISGIOPMessage::create(ProtocolEngine::Connection*,unsigned long long)(0x209d6ce0, 0x0, 0x0)
VISGIOPMessage::create(ProtocolEngine::Connection*,unsigned long long)(0x209d6ce0, 0x0, 0x0)
at 0xd23c50f4 VISGIOPConn::receive_message(unsigned long long)(0x20a00118, 0x0, 0x0)
The issue occurs despite setting the vbroker.se.<scm-name>.scm.<scm-name>.manager.connectionMaxIdle to non-zero.
Resolution:
This paragraph extracted from http://en.wikipedia.org/wiki/Transmission_Control_Protocol explains the cause of the hang
Flow Control:
“When a receiver advertises a window size of 0, the sender stops sending data and starts the persist timer. The persist timer is used to protect TCP from a deadlock situation that could arise if a subsequent window size update from the receiver is lost, and the sender cannot send more data until receiving a new window size update from the receiver. When the persist timer expires, the TCP sender attempts recovery by sending a small packet so that the receiver responds by sending another acknowledgement containing the new window size”
A new property vbroker.orb.serverRecvTimeout is introduced to prevent the read operation from blocking the connection indefinitely. Once the timeout expires, it closes the connection. The timeout is set in seconds. The default value is zero which means no timeout.
Flow Control:
“When a receiver advertises a window size of 0, the sender stops sending data and starts the persist timer. The persist timer is used to protect TCP from a deadlock situation that could arise if a subsequent window size update from the receiver is lost, and the sender cannot send more data until receiving a new window size update from the receiver. When the persist timer expires, the TCP sender attempts recovery by sending a small packet so that the receiver responds by sending another acknowledgement containing the new window size”
A new property vbroker.orb.serverRecvTimeout is introduced to prevent the read operation from blocking the connection indefinitely. Once the timeout expires, it closes the connection. The timeout is set in seconds. The default value is zero which means no timeout.
In VisiBroker for Java, this property is only applicable if NIO Socket is configured at the server-side.
#VisiBroker
#connectionMaxIdle
#serverRecvTimeout
#Security