> On July 22, 2016, 10:18 p.m., Jason Huynh wrote: > > geode-cq/src/main/java/com/gemstone/gemfire/cache/query/internal/cq/CqServiceImpl.java, > > line 2008 > > <https://reviews.apache.org/r/50361/diff/1/?file=1451412#file1451412line2008> > > > > Would it make sense to check the cq state prior to this and if it's not > > running to not check or send status?
We can't do this by looking at the closed state; as the CQ may have been registered, but stopped...Not intial state...We can do by checking on init state, but its not public (not returned)...Also we can't do this by using public APIs isRunning() and isStopped(); as isStopped() is true in either one of the condition, stopped or in init state... I think checking with proxy indicates that the proxy may not have been initialized at this time... - anilkumar ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/50361/#review143288 ----------------------------------------------------------- On July 22, 2016, 10:02 p.m., anilkumar gingade wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/50361/ > ----------------------------------------------------------- > > (Updated July 22, 2016, 10:02 p.m.) > > > Review request for geode, anilkumar gingade, Barry Oglesby, Jason Huynh, > William Markito, nabarun nag, Dan Smith, and xiaojian zhou. > > > Repository: geode > > > Description > ------- > > GEODE-1687: NPE during CqStatusListener method invocation. > > NPE in: CqServiceImpl.java -> invokeCqsConnected() > Line#2011 > Pool cqPool = cQuery.getCQProxy().getPool(); > > > When a connection relating to CQ is established or dropped, CqStatusListner > is invoked to indicate connection/subscription status. This allows > application to handle if all the subscription connection is lost for CQs. > > Looking at the code path for CqStatusListener there is a chance of NPE > getting thrown in CqServiceImpl.invokeCqsConnected when CQ is executed using > the Bridge loader interface (old way of client-server > connection).... > > When a pool or bridge-loader connection is made or dropped, the code gets all > the CQs; checks if the CQ is registered using that connection/pool name and > invokes the CqStatusListner... > > The code to check if CQ is using the corresponding pool: > Pool cqPool = cQuery.getCQProxy().getPool(); > > If the CQ is getting executed using Bridge loader, the CqProxy for CQ is not > set when its constructed; its set when it gets executed....During this time > the call to cQuery.getCQProxy() could throw NPE. > > > Diffs > ----- > > > geode-cq/src/main/java/com/gemstone/gemfire/cache/query/internal/cq/CqServiceImpl.java > e1e158c > > Diff: https://reviews.apache.org/r/50361/diff/ > > > Testing > ------- > > > Thanks, > > anilkumar gingade > >