Hi,
We've been doing some scalability tests on our Java software that uses
JCA/CAJ.
I came across a CAJ problem which resulted in all monitor events from an
instance of our test IOC ceasing to arrive. Then another instance would
stop sending events, etc.. Eventually CAJ wasn't giving me any monitor
events at all.
I have tracked this down to the processRead method in
com.cosylab.epics.caj.impl.CATransport. Basically if flow control gets
enabled, and then there is a zero-byte read, then flow control never
gets turned off and we never hear from the IOC again. I have addressed
the bug by checking the flow control logic before checking for the
zero-byte read, something like this:
// read
int bytesRead = channel.read(socketBuffer);
if (bytesRead < 0)
{
// error (disconnect, end-of-stream) detected
close (true);
return;
}
// flow control check
if (socketBuffer.hasRemaining())
{
// buffer not full, disable flow control
bufferFullCount = 0;
if (flowControlActive)
disableFlowControl();
}
if (bytesRead == 0) {
break;
}
Perhaps the CAJ maintainers would like to incorporate this fix or
something similar into the upstream source?
Regards,
David