You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "wu wen (JIRA)" <ji...@apache.org> on 2016/10/31 10:10:58 UTC

[jira] [Comment Edited] (ZOOKEEPER-1394) ClassNotFoundException on shutdown of client

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15620987#comment-15620987 ] 

wu wen edited comment on ZOOKEEPER-1394 at 10/31/16 10:10 AM:
--------------------------------------------------------------

Hi [~eolivelli] there are two solutions
1. shutting down zk client before the application.
2. to make the client eagerly load the ZooTrace class by using it at boot or in other convenient place.

I think the problem is that the application does not have a graceful shutdown.


was (Author: wuwen):
Hi [~eolivelli] there are two solutions
1. shutting down zk before the application.
2. to make the client eagerly load the ZooTrace class by using it at boot or in other convenient place.

I think the problem is that the application does not have a graceful shutdown.

> ClassNotFoundException on shutdown of client
> --------------------------------------------
>
>                 Key: ZOOKEEPER-1394
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1394
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: java client
>    Affects Versions: 3.4.2
>         Environment: OS X 10.7 java version "1.6.0_29"
>            Reporter: Herman Meerlo
>            Assignee: wu wen
>            Priority: Minor
>         Attachments: ZOOKEEPER-1394.patch
>
>
> When close() is called on the ZooKeeper instance from a ContextListener (contextDestroyed) there is no way to synchronize with the fact that the EventThread and SendThread have actually finished their work. The problem lies in the SendThread which makes a call to ZooTrace when it exits, but that class has not been loaded yet. Because the ContextListener could not synchronize with the death of the threads the classloader has already disappeared, resulting in a ClassNotFoundException.
> My personal opinion is that the close() method should probably wait until the event and send thread have actually died.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)