cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Dusbabek (JIRA)" <>
Subject [jira] Commented: (CASSANDRA-693) MessagingService really doesn't need an instance method
Date Thu, 14 Jan 2010 14:46:54 GMT


Gary Dusbabek commented on CASSANDRA-693:

This patch makes it so that MessageService cannot be reused after shutdown().  There is a
significant amount of work that goes on in the constructor that was executed by instance()
if shutdown() had been called previously.

One approach would be to replace shutdown() with a reset() that does what shutdown() does
now but takes the additional step of re-initializing things (the work done in the constructor).
 Kind of lame, but it would make the code functionally similar to the way it was before the

But then again, it might be wasted work since other services limit how reentrant cassandra
can be overall.  Perhaps a better approach would be to state unequivocally that the cassandra
services *are not* reentrant and make sure that Bad Things happen if MessagingService is used
after it's shutdown() has been called.

> MessagingService really doesn't need an instance method
> -------------------------------------------------------
>                 Key: CASSANDRA-693
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Jeff Hodges
>            Priority: Minor
>         Attachments: messaging_service_property.patch
> MessagingService.instance() is only used to get the perf gain from not allocating a new
object everytime we send a message or get a verb handler. There is no instance data munged
during it's existence and the way even the one instance is used currently is not thread-safe.
It's basically a singleton with a weirdo lock around it's creation.
> It seems kind of silly to have all the mental overhead of Yet Another Not-Constructor
Constructor. We could do many things instead. One idea is to just make MessagingService.instance
a public property of it and be done with the whole thing.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message