[jira] [Created] (ZOOKEEPER-2958) Don't reconnect zookeeper server when tomcat stopped

2017-12-18 Thread Zhaohui Yu (JIRA)
Zhaohui Yu created ZOOKEEPER-2958:
-

 Summary: Don't reconnect zookeeper server when tomcat stopped
 Key: ZOOKEEPER-2958
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2958
 Project: ZooKeeper
  Issue Type: Improvement
  Components: java client
Reporter: Zhaohui Yu


If run zookeeper client in tomcat:
1. create zookeeper connect to zookeeper server
2. connected zookeeper server
3. webapp stopped cause by other reason, so the WebappClassLoader in tomcat 
can't load new class.
4. run method in ClientCnxn.SendThread has a while loop catch all throwable, so 
the client will reconnect to the server, and then repeat these steps forever.

So, suggest give a StateChecker interface user can override it
{code:java}
public class ClientCnxn{
  public class SendThread extend Thread{
public void run(){
   while(stateChecker.check()){
   }
 }
  }
}
{code}

So I can pass a StateChecker to check the tomcat WebappClassLoader state.

Thanks




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (ZOOKEEPER-2319) UnresolvedAddressException cause the QuorumCnxManager.Listener exit

2015-11-09 Thread Zhaohui Yu (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zhaohui Yu updated ZOOKEEPER-2319:
--
Description: 
Given three nodes, the leader on 2, but some issue with this machine, so I 
shutdown this machine, and change the host name to another machine.
Then I start the node in the new machine, but the new node can not join.
I found the the 1 and 3's Listener thread exit.

With the code of Listener's run method:
I think we should catch UnresolvedAddressException to avoid the Listener exit.
@Override
public void run() {
   
while((!shutdown) && (numRetries < 3)){
try {
   // bind and accept
receiveConnection(client);
  
} catch (IOException e) {

}
}
//
}

  was:
Given three nodes, the leader on 2, but some issue with this machine, so I 
shutdown this machine, and change the host name to another machine.
Then I start the node in the new machine, but the new node can not join.
I found the the 1 and 3's Listener thread exit.

With the code of Listener's run method:
I don't think place the receiveConnection call in this try catch block is a 
good idea. And I think we should catch UnresolvedAddressException to avoid the 
Listener exit.
@Override
public void run() {
   
while((!shutdown) && (numRetries < 3)){
try {
   // bind and accept
receiveConnection(client);
  
} catch (IOException e) {

}
}
//
}


> UnresolvedAddressException cause the QuorumCnxManager.Listener exit
> ---
>
> Key: ZOOKEEPER-2319
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2319
> Project: ZooKeeper
>  Issue Type: Bug
>Affects Versions: 3.4.6
>Reporter: Zhaohui Yu
>Priority: Critical
>
> Given three nodes, the leader on 2, but some issue with this machine, so I 
> shutdown this machine, and change the host name to another machine.
> Then I start the node in the new machine, but the new node can not join.
> I found the the 1 and 3's Listener thread exit.
> With the code of Listener's run method:
> I think we should catch UnresolvedAddressException to avoid the Listener exit.
> @Override
> public void run() {
>
> while((!shutdown) && (numRetries < 3)){
> try {
>// bind and accept
> receiveConnection(client);
>   
> } catch (IOException e) {
> 
> }
> }
> //
> }



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


[jira] [Updated] (ZOOKEEPER-2319) UnresolvedAddressException cause the QuorumCnxManager.Listener exit

2015-11-09 Thread Zhaohui Yu (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zhaohui Yu updated ZOOKEEPER-2319:
--
Description: 
Given three nodes, the leader on 2, but some issue with this machine, so I 
shutdown this machine, and change the host name to another machine.
Then I start the node in the new machine, but the new node can not join.
I found the the 1 and 3's Listener thread exit.

With the code of Listener's run method:
I don't think place the receiveConnection call in this try catch block is a 
good idea. And I think we should catch UnresolvedAddressException to avoid the 
Listener exit.
@Override
public void run() {
   
while((!shutdown) && (numRetries < 3)){
try {
   // bind and accept
receiveConnection(client);
  
} catch (IOException e) {

}
}
//
}

  was:
Given three nodes, the leader on 2, but some issue with this machine, so I 
shutdown this machine, and change the host name to another machine.
Then I start the node in the new machine, but the new node can not join.
I found the the 1 and 3's Listener thread exit.

With the code of Listener's run method:
I don't think place the receiveConnection call in the try is a good idea. And I 
think we should catch UnresolvedAddressException to avoid the Listener exit.
@Override
public void run() {
   
while((!shutdown) && (numRetries < 3)){
try {
   // bind and accept
receiveConnection(client);
  
} catch (IOException e) {

}
}
//
}


> UnresolvedAddressException cause the QuorumCnxManager.Listener exit
> ---
>
> Key: ZOOKEEPER-2319
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2319
> Project: ZooKeeper
>  Issue Type: Bug
>Affects Versions: 3.4.6
>Reporter: Zhaohui Yu
>Priority: Critical
>
> Given three nodes, the leader on 2, but some issue with this machine, so I 
> shutdown this machine, and change the host name to another machine.
> Then I start the node in the new machine, but the new node can not join.
> I found the the 1 and 3's Listener thread exit.
> With the code of Listener's run method:
> I don't think place the receiveConnection call in this try catch block is a 
> good idea. And I think we should catch UnresolvedAddressException to avoid 
> the Listener exit.
> @Override
> public void run() {
>
> while((!shutdown) && (numRetries < 3)){
> try {
>// bind and accept
> receiveConnection(client);
>   
> } catch (IOException e) {
> 
> }
> }
> //
> }



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


[jira] [Created] (ZOOKEEPER-2319) UnresolvedAddressException cause the QuorumCnxManager.Listener exit

2015-11-09 Thread Zhaohui Yu (JIRA)
Zhaohui Yu created ZOOKEEPER-2319:
-

 Summary: UnresolvedAddressException cause the 
QuorumCnxManager.Listener exit
 Key: ZOOKEEPER-2319
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2319
 Project: ZooKeeper
  Issue Type: Bug
Affects Versions: 3.4.6
Reporter: Zhaohui Yu
Priority: Critical


Given three nodes, the leader on 2, but some issue with this machine, so I 
shutdown this machine, and change the host name to another machine.
Then I start the node in the new machine, but the new node can not join.
I found the the 1 and 3's Listener thread exit.

With the code of Listener's run method:
I don't think place the receiveConnection call in the try is a good idea.
@Override
public void run() {
   
while((!shutdown) && (numRetries < 3)){
try {
   // bind and accept
receiveConnection(client);
  
} catch (IOException e) {

}
}
//
}



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


[jira] [Updated] (ZOOKEEPER-2319) UnresolvedAddressException cause the QuorumCnxManager.Listener exit

2015-11-09 Thread Zhaohui Yu (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zhaohui Yu updated ZOOKEEPER-2319:
--
Description: 
Given three nodes, the leader on 2, but some issue with this machine, so I 
shutdown this machine, and change the host name to another machine.
Then I start the node in the new machine, but the new node can not join.
I found the the 1 and 3's Listener thread exit.

With the code of Listener's run method:
I don't think place the receiveConnection call in the try is a good idea. And I 
think we should catch UnresolvedAddressException to avoid the Listener exit.
@Override
public void run() {
   
while((!shutdown) && (numRetries < 3)){
try {
   // bind and accept
receiveConnection(client);
  
} catch (IOException e) {

}
}
//
}

  was:
Given three nodes, the leader on 2, but some issue with this machine, so I 
shutdown this machine, and change the host name to another machine.
Then I start the node in the new machine, but the new node can not join.
I found the the 1 and 3's Listener thread exit.

With the code of Listener's run method:
I don't think place the receiveConnection call in the try is a good idea.
@Override
public void run() {
   
while((!shutdown) && (numRetries < 3)){
try {
   // bind and accept
receiveConnection(client);
  
} catch (IOException e) {

}
}
//
}


> UnresolvedAddressException cause the QuorumCnxManager.Listener exit
> ---
>
> Key: ZOOKEEPER-2319
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2319
> Project: ZooKeeper
>  Issue Type: Bug
>Affects Versions: 3.4.6
>Reporter: Zhaohui Yu
>Priority: Critical
>
> Given three nodes, the leader on 2, but some issue with this machine, so I 
> shutdown this machine, and change the host name to another machine.
> Then I start the node in the new machine, but the new node can not join.
> I found the the 1 and 3's Listener thread exit.
> With the code of Listener's run method:
> I don't think place the receiveConnection call in the try is a good idea. And 
> I think we should catch UnresolvedAddressException to avoid the Listener exit.
> @Override
> public void run() {
>
> while((!shutdown) && (numRetries < 3)){
> try {
>// bind and accept
> receiveConnection(client);
>   
> } catch (IOException e) {
> 
> }
> }
> //
> }



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