Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: CAJ Flow Control Bug
From: David Brodrick <David.Brodrick@csiro.au>
To: EPICS Tech-Talk <tech-talk@aps.anl.gov>
Date: Thu, 26 May 2011 14:20:08 +1000
Many thanks to Matej Sekoranja, the fix for this bug has now been incorporated into the source for caj-1.1.8beta.
Regards,
 David


David Brodrick wrote:
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



References:
CAJ Flow Control Bug David Brodrick

Navigate by Date:
Prev: RE: Problems with executing caExample for 3.14.12.1 Mark Rivers
Next: record ring buffer flushing Hinko Kocevar
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: CAJ Flow Control Bug David Brodrick
Next: vxWorks network problems Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·