JMX Connection - Cassandra

Stefan Negrea snegrea at redhat.com
Tue Oct 30 15:40:42 UTC 2012


Thank you for the review and suggestions :)

----- Original Message -----
> From: "Elias Ross" <genman at noderunner.net>
> To: rhq-devel at lists.fedorahosted.org
> Sent: Friday, October 26, 2012 1:21:07 PM
> Subject: Re: JMX Connection - Cassandra
> 
> On Fri, Oct 26, 2012 at 10:46 AM, Stefan Negrea <snegrea at redhat.com>
> wrote:
> 
> >
> > Here is the code change. Code reviews would be greatly appreciated.
> > http://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?h=jsanda/cassandra-plugin&id=4c9f26dc5301d3f3e4cd7ac128d496b5dfa2ae4c
> 
> connectionProvider and connection should probably be declared
> 'volatile'.


This is a very good suggestion since those attributes might be accessed by multiple threads simultaneously (eg. availability collector and operation executor). Here is the code commit, it should make it into master soon:

http://git.fedorahosted.org/cgit/rhq/rhq.git/commit/?h=jsanda/cassandra-plugin&id=5be91f0479839d19bd0b776046d1d0d13eda5a6e


> 
> One thing that should also be done is call close on the connection
> even if the connection provider goes down. This may not matter, but
> that connection could be holding threads.
> 
> See: https://bugzilla.redhat.com/show_bug.cgi?id=848938 "JMX Plugin -
> Leaking connector threads"

I do not see how the issue from BZ 848938 is applicable here. The portion of the code that I modified relies on the EMS library. I walked through the connection provider code (from the EMS library) and I do not see anything similar to the issue addressed in BZ 848938. 

My concern for closing first is with regards to listeners. Without calling close, all the listeners will just be reconnected (this is the current implementation). If close is called, then the listeners are closed and then re-opened on reconnect. And I am not sure what impact will that have on any code that relies on the JMX plugin.


Could you give me more details on why BZ 848938 is applicable?


Thank you,
Stefan Negrea


More information about the rhq-devel mailing list