Topic destroy method does not work

30 views
Skip to first unread message

joan

unread,
Dec 10, 2009, 6:39:41 AM12/10/09
to Hazelcast
Hello,

I'm using a topic in this way:

public void start()
{
this.sincroTopic = Hazelcast.getTopic(TOPIC_NAME);
this.sincroTopic.addMessageListener(this);
}

public void stop() { this.sincroTopic.destroy(); }

After calling the destroy method (and with Tomcat down), it seems that
all threads (resources) associated to this topic are not destroyed. I
can see in the eclipse debugger:

Thread [hz.InThread] (Running)
Thread [hz.OutThread] (Running)
Thread [hz.QueryThread] (Running)
Thread [hz.MulticastThread] (Running)
Thread [hz.ServiceThread] (Running)
Thread [hz.executor-_hzInstance_0-thread-1] (Running)
Thread [hz.executor-_hzInstance_0-thread-2] (Running)
Thread [hz.executor-_hzInstance_0-thread-3] (Running)

Because of this, I can't start Tomcat again without killing it
previously.

Thanks,

Joan.

Talip Ozturk

unread,
Dec 10, 2009, 7:04:16 AM12/10/09
to hazelcast
This is expected. Because topic.destroy() only destroy the named topic
in the Hazelcast cluster. Hazelcast is still active. For clean
shutdown, you have to shutdown Hazelcast with Hazelcast.shutdown().
You don't need to destroy your topic in the entire cluster as other
live nodes might be still using it. Just do Hazelcast.shutdown() when
your JVM(application) shuts down.

-talip
> --
>
> You received this message because you are subscribed to the Google Groups "Hazelcast" group.
> To post to this group, send email to haze...@googlegroups.com.
> To unsubscribe from this group, send email to hazelcast+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hazelcast?hl=en.
>
>
>

joan

unread,
Dec 10, 2009, 9:58:28 AM12/10/09
to Hazelcast
Hello Talip,

I don't think so. Debugging, the exact place where these threads
appears is after executing "Hazelcast.getTopic()".

public void start()
{
--> No threads here associated to Hazelcast.

this.sincroTopic = Hazelcast.getTopic(TOPIC_NAME);

--> Here appears the following resources:
Thread [hz.InThread] (Running)
Thread [hz.OutThread] (Running)
Thread [hz.MulticastThread] (Running)
Thread [hz.ServiceThread] (Running)
Thread [hz.QueryThread] (Running)
Thread [hz.executor-_hzInstance_0-thread-1] (Running)
Thread[pool-2-thread-1] (Running)
<-----------------------------------------------------------
Thread[pool-2-thread-2] (Running)
<-----------------------------------------------------------
Thread [hz.executor-_hzInstance_0-thread-2] (Running)
Thread [hz.executor-_hzInstance_0-thread-3] (Running)

// Add listener.
this.sincroTopic.addMessageListener(this);
}


And after several executions, the place where this "pool-2" appears is
always just after "Thread [hz.executor-_hzInstance_0-thread-1]". I
don't know if this can help you.

Thanks,

Joan.

------Mensaje original------
De: Talip Ozturk
Para:Ricardo Gonzalez
Asunto: Re: Topic destroy method does not work
Enviado: 10 Dic, 2009 15:05

All hazelcast thread names starts with "hz."

Would these threads be your or your container's threads?

-talip

On 10 dic, 13:04, Talip Ozturk <ta...@hazelcast.com> wrote:
> This is expected. Because topic.destroy() only destroy the named topic
> in the Hazelcast cluster. Hazelcast is still active. For clean
> shutdown, you have to shutdown Hazelcast with Hazelcast.shutdown().
> You don't need to destroy your topic in the entire cluster as other
> live nodes might be still using it. Just do Hazelcast.shutdown() when
> your JVM(application) shuts down.
>
> -talip
>

Talip Ozturk

unread,
Dec 10, 2009, 10:22:44 AM12/10/09
to hazelcast
What is your hazelcast version?

can you please try the latest snapshot and see if you are having the
same problem?

-talip

joan

unread,
Dec 10, 2009, 11:50:23 AM12/10/09
to Hazelcast
Hello,

I'm using the latest snapshot (1.8)

Joan.

On 10 dic, 16:22, Talip Ozturk <ta...@hazelcast.com> wrote:
> What is your hazelcast version?
>
> can you please try the latest snapshot and see if you are having the
> same problem?
>
> -talip
>

Talip Ozturk

unread,
Dec 10, 2009, 12:31:22 PM12/10/09
to hazelcast
I am quite sure that all hazelcast thread names start with "hz."

Is everything shutting down fine if you remove Hazelcast entirely?

-talip

joan

unread,
Dec 10, 2009, 1:02:13 PM12/10/09
to Hazelcast
Hello,

I've made this test just now. And these two threads of pool-2 don't
appear. And I can shut down Tomcat perfectly (and after this, no java
process is shown with the 'ps' linux command).

Joan,

On 10 dic, 18:31, Talip Ozturk <ta...@hazelcast.com> wrote:
> I am quite sure that all hazelcast thread names start with "hz."
>
> Is everything shutting down fine if you remove Hazelcast entirely?
>
> -talip
>

Joan Balagueró

unread,
Dec 18, 2009, 7:52:38 AM12/18/09
to Hazelcast
Hello,

In fact, the exact place where this thread pool appears is when
calling Hazelcast.newHazelcastInstance(), and this pool always appears
just after "hz.executor-_hzInstance_0-thread-1".

Joan.

Joan Balagueró

unread,
Dec 24, 2009, 5:00:59 AM12/24/09
to Hazelcast
Hello,

With the latest snapshot (1.8.1), this problem continues. Do you want
I add an issue with it?

Joan.

Talip Ozturk

unread,
Dec 24, 2009, 11:36:16 AM12/24/09
to hazelcast
Yes and please provide as much information as you can.

Thanks,
-talip

Reply all
Reply to author
Forward
0 new messages