ZooKeeper_branch35_jdk7 - Build # 915 - Still Failing

2017-04-05 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper_branch35_jdk7/915/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 62.57 MB...]
[junit] 2017-04-05 08:49:20,658 [myid:127.0.0.1:19424] - WARN  
[main-SendThread(127.0.0.1:19424):ClientCnxn$SendThread@1235] - Session 
0x10367f1e670 for server 127.0.0.1/127.0.0.1:19424, unexpected error, 
closing socket connection and attempting reconnect
[junit] java.net.ConnectException: Connection refused
[junit] at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
[junit] at 
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744)
[junit] at 
org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:357)
[junit] at 
org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1214)
[junit] 2017-04-05 08:49:20,787 [myid:127.0.0.1:19427] - INFO  
[main-SendThread(127.0.0.1:19427):ClientCnxn$SendThread@1113] - Opening socket 
connection to server 127.0.0.1/127.0.0.1:19427. Will not attempt to 
authenticate using SASL (unknown error)
[junit] 2017-04-05 08:49:20,788 [myid:127.0.0.1:19427] - WARN  
[main-SendThread(127.0.0.1:19427):ClientCnxn$SendThread@1235] - Session 
0x20367f1e6ce for server 127.0.0.1/127.0.0.1:19427, unexpected error, 
closing socket connection and attempting reconnect
[junit] java.net.ConnectException: Connection refused
[junit] at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
[junit] at 
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744)
[junit] at 
org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:357)
[junit] at 
org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1214)
[junit] 2017-04-05 08:49:20,804 [myid:] - INFO  [ProcessThread(sid:0 
cport:19547)::PrepRequestProcessor@613] - Processed session termination for 
sessionid: 0x10367f548e4
[junit] 2017-04-05 08:49:20,805 [myid:] - INFO  
[SyncThread:0:MBeanRegistry@128] - Unregister MBean 
[org.apache.ZooKeeperService:name0=StandaloneServer_port19547,name1=Connections,name2=127.0.0.1,name3=0x10367f548e4]
[junit] 2017-04-05 08:49:20,805 [myid:] - INFO  [main:ZooKeeper@1326] - 
Session: 0x10367f548e4 closed
[junit] 2017-04-05 08:49:20,805 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@82] - Memory used 204627
[junit] 2017-04-05 08:49:20,805 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@87] - Number of threads 2428
[junit] 2017-04-05 08:49:20,806 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@102] - FINISHED TEST METHOD 
testWatcherAutoResetWithLocal
[junit] 2017-04-05 08:49:20,806 [myid:] - INFO  [main:ClientBase@543] - 
tearDown starting
[junit] 2017-04-05 08:49:20,806 [myid:] - INFO  [main:ClientBase@513] - 
STOPPING server
[junit] 2017-04-05 08:49:20,806 [myid:] - INFO  
[main:NettyServerCnxnFactory@464] - shutdown called 0.0.0.0/0.0.0.0:19547
[junit] 2017-04-05 08:49:20,806 [myid:] - INFO  
[main-EventThread:ClientCnxn$EventThread@513] - EventThread shut down for 
session: 0x10367f548e4
[junit] 2017-04-05 08:49:20,810 [myid:] - INFO  [main:ZooKeeperServer@541] 
- shutting down
[junit] 2017-04-05 08:49:20,810 [myid:] - ERROR [main:ZooKeeperServer@505] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-04-05 08:49:20,810 [myid:] - INFO  
[main:SessionTrackerImpl@232] - Shutting down
[junit] 2017-04-05 08:49:20,810 [myid:] - INFO  
[main:PrepRequestProcessor@1004] - Shutting down
[junit] 2017-04-05 08:49:20,810 [myid:] - INFO  
[main:SyncRequestProcessor@191] - Shutting down
[junit] 2017-04-05 08:49:20,811 [myid:] - INFO  [ProcessThread(sid:0 
cport:19547)::PrepRequestProcessor@156] - PrepRequestProcessor exited loop!
[junit] 2017-04-05 08:49:20,814 [myid:] - INFO  
[SyncThread:0:SyncRequestProcessor@169] - SyncRequestProcessor exited!
[junit] 2017-04-05 08:49:20,814 [myid:] - INFO  
[main:FinalRequestProcessor@481] - shutdown of request processor complete
[junit] 2017-04-05 08:49:20,814 [myid:] - INFO  [main:MBeanRegistry@128] - 
Unregister MBean 
[org.apache.ZooKeeperService:name0=StandaloneServer_port19547,name1=InMemoryDataTree]
[junit] 2017-04-05 08:49:20,814 [myid:] - INFO  [main:MBeanRegistry@128] - 
Unregister MBean [org.apache.ZooKeeperService:name0=StandaloneServer_port19547]
[junit] 2017-04-05 08:49:20,815 [myid:] - INFO  
[main:FourLetterWordMain@85] - connecting to 127.0.0.1 19547
[junit] 2017-04-05 08:49:20,815 [myid:] - INFO  [main:JMXEnv@146] - 
ensureOnly:[]
[junit] 2017-04-05 08:49:20,827 [myid:] - INFO  [main:ClientBase@568] - 
fdcount after test is: 7133 at start it was 7129
[junit] 2017-04-05 08:49:20,828 [myid:] - IN

[jira] [Commented] (ZOOKEEPER-2604) Temporary node has not been deleted

2017-04-05 Thread licihua (JIRA)

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

licihua commented on ZOOKEEPER-2604:


This is a bug or not? More detail for it?

> Temporary node has not been deleted
> ---
>
> Key: ZOOKEEPER-2604
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2604
> Project: ZooKeeper
>  Issue Type: Bug
>Affects Versions: 3.4.6
> Environment: linux centos , jdk7
>Reporter: sunqb
> Fix For: 3.4.6
>
>
> i use zkclient to connect zookeeper-server , but sometime when i close my 
> zkclient ,the Temporary node can't be deleted。i have search this bug,and i 
> fixed it by delete the data dir



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


ZooKeeper-trunk-jdk8 - Build # 1005 - Failure

2017-04-05 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper-trunk-jdk8/1005/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 64.77 MB...]
[junit] 2017-04-05 11:56:33,076 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@102] - FINISHED TEST METHOD 
testWatcherAutoResetWithLocal
[junit] 2017-04-05 11:56:33,076 [myid:] - INFO  [main:ClientBase@558] - 
tearDown starting
[junit] 2017-04-05 11:56:33,076 [myid:] - INFO  [main:ClientBase@528] - 
STOPPING server
[junit] 2017-04-05 11:56:33,076 [myid:] - INFO  
[main:NettyServerCnxnFactory@464] - shutdown called 0.0.0.0/0.0.0.0:16854
[junit] 2017-04-05 11:56:33,076 [myid:] - INFO  
[main-EventThread:ClientCnxn$EventThread@513] - EventThread shut down for 
session: 0x100fa55e957
[junit] 2017-04-05 11:56:33,077 [myid:] - INFO  [main:MBeanRegistry@128] - 
Unregister MBean 
[org.apache.ZooKeeperService:name0=StandaloneServer_port16854,name1=Connections,name2=127.0.0.1,name3=0x100fa55e957]
[junit] 2017-04-05 11:56:33,077 [myid:] - INFO  [main:ZooKeeperServer@542] 
- shutting down
[junit] 2017-04-05 11:56:33,078 [myid:] - ERROR [main:ZooKeeperServer@506] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-04-05 11:56:33,078 [myid:] - INFO  
[main:SessionTrackerImpl@232] - Shutting down
[junit] 2017-04-05 11:56:33,078 [myid:] - INFO  
[main:PrepRequestProcessor@1008] - Shutting down
[junit] 2017-04-05 11:56:33,078 [myid:] - INFO  
[main:SyncRequestProcessor@191] - Shutting down
[junit] 2017-04-05 11:56:33,079 [myid:] - INFO  [ProcessThread(sid:0 
cport:16854)::PrepRequestProcessor@157] - PrepRequestProcessor exited loop!
[junit] 2017-04-05 11:56:33,079 [myid:] - INFO  
[SyncThread:0:SyncRequestProcessor@169] - SyncRequestProcessor exited!
[junit] 2017-04-05 11:56:33,079 [myid:] - INFO  
[main:FinalRequestProcessor@481] - shutdown of request processor complete
[junit] 2017-04-05 11:56:33,079 [myid:] - INFO  [main:MBeanRegistry@128] - 
Unregister MBean 
[org.apache.ZooKeeperService:name0=StandaloneServer_port16854,name1=InMemoryDataTree]
[junit] 2017-04-05 11:56:33,079 [myid:] - INFO  [main:MBeanRegistry@128] - 
Unregister MBean [org.apache.ZooKeeperService:name0=StandaloneServer_port16854]
[junit] 2017-04-05 11:56:33,079 [myid:] - INFO  
[main:FourLetterWordMain@85] - connecting to 127.0.0.1 16854
[junit] 2017-04-05 11:56:33,080 [myid:] - INFO  [main:JMXEnv@146] - 
ensureOnly:[]
[junit] 2017-04-05 11:56:33,082 [myid:127.0.0.1:16731] - INFO  
[main-SendThread(127.0.0.1:16731):ClientCnxn$SendThread@1113] - Opening socket 
connection to server 127.0.0.1/127.0.0.1:16731. Will not attempt to 
authenticate using SASL (unknown error)
[junit] 2017-04-05 11:56:33,083 [myid:127.0.0.1:16731] - WARN  
[main-SendThread(127.0.0.1:16731):ClientCnxn$SendThread@1235] - Session 
0x100fa52a256 for server 127.0.0.1/127.0.0.1:16731, unexpected error, 
closing socket connection and attempting reconnect
[junit] java.net.ConnectException: Connection refused
[junit] at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
[junit] at 
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
[junit] at 
org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:357)
[junit] at 
org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1214)
[junit] 2017-04-05 11:56:33,083 [myid:] - INFO  [main:ClientBase@583] - 
fdcount after test is: 1387 at start it was 1383
[junit] 2017-04-05 11:56:33,083 [myid:] - INFO  [main:ClientBase@585] - 
sleeping for 20 secs
[junit] 2017-04-05 11:56:33,083 [myid:] - INFO  [main:ZKTestCase$1@68] - 
SUCCEEDED testWatcherAutoResetWithLocal
[junit] 2017-04-05 11:56:33,083 [myid:] - INFO  [main:ZKTestCase$1@63] - 
FINISHED testWatcherAutoResetWithLocal
[junit] 2017-04-05 11:56:33,088 [myid:127.0.0.1:16734] - INFO  
[main-SendThread(127.0.0.1:16734):ClientCnxn$SendThread@1113] - Opening socket 
connection to server 127.0.0.1/127.0.0.1:16734. Will not attempt to 
authenticate using SASL (unknown error)
[junit] 2017-04-05 11:56:33,096 [myid:127.0.0.1:16734] - WARN  
[main-SendThread(127.0.0.1:16734):ClientCnxn$SendThread@1235] - Session 
0x200fa52a635 for server 127.0.0.1/127.0.0.1:16734, unexpected error, 
closing socket connection and attempting reconnect
[junit] java.net.ConnectException: Connection refused
[junit] at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
[junit] at 
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
[junit] at 
org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:357)
[junit] at 
org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1214)
[ju

ZooKeeper_branch34_openjdk7 - Build # 1455 - Failure

2017-04-05 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper_branch34_openjdk7/1455/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 30.99 MB...]
[junit] 2017-04-05 15:28:38,534 [myid:] - INFO  
[main:SessionTrackerImpl@225] - Shutting down
[junit] 2017-04-05 15:28:38,534 [myid:] - INFO  
[main:PrepRequestProcessor@764] - Shutting down
[junit] 2017-04-05 15:28:38,534 [myid:] - INFO  
[main:SyncRequestProcessor@208] - Shutting down
[junit] 2017-04-05 15:28:38,534 [myid:] - INFO  [ProcessThread(sid:0 
cport:11221)::PrepRequestProcessor@143] - PrepRequestProcessor exited loop!
[junit] 2017-04-05 15:28:38,535 [myid:] - INFO  
[SyncThread:0:SyncRequestProcessor@186] - SyncRequestProcessor exited!
[junit] 2017-04-05 15:28:38,535 [myid:] - INFO  
[main:FinalRequestProcessor@402] - shutdown of request processor complete
[junit] 2017-04-05 15:28:38,535 [myid:] - INFO  
[main:FourLetterWordMain@62] - connecting to 127.0.0.1 11221
[junit] 2017-04-05 15:28:38,536 [myid:] - INFO  [main:JMXEnv@147] - 
ensureOnly:[]
[junit] 2017-04-05 15:28:38,537 [myid:] - INFO  [main:ClientBase@445] - 
STARTING server
[junit] 2017-04-05 15:28:38,537 [myid:] - INFO  [main:ClientBase@366] - 
CREATING server instance 127.0.0.1:11221
[junit] 2017-04-05 15:28:38,538 [myid:] - INFO  
[main:NIOServerCnxnFactory@89] - binding to port 0.0.0.0/0.0.0.0:11221
[junit] 2017-04-05 15:28:38,538 [myid:] - INFO  [main:ClientBase@341] - 
STARTING server instance 127.0.0.1:11221
[junit] 2017-04-05 15:28:38,538 [myid:] - INFO  [main:ZooKeeperServer@173] 
- Created server with tickTime 3000 minSessionTimeout 6000 maxSessionTimeout 
6 datadir 
/home/jenkins/jenkins-slave/workspace/ZooKeeper_branch34_openjdk7/build/test/tmp/test9052002164850329985.junit.dir/version-2
 snapdir 
/home/jenkins/jenkins-slave/workspace/ZooKeeper_branch34_openjdk7/build/test/tmp/test9052002164850329985.junit.dir/version-2
[junit] 2017-04-05 15:28:38,542 [myid:] - ERROR [main:ZooKeeperServer@472] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-04-05 15:28:38,542 [myid:] - INFO  
[main:FourLetterWordMain@62] - connecting to 127.0.0.1 11221
[junit] 2017-04-05 15:28:38,543 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11221:NIOServerCnxnFactory@192] - 
Accepted socket connection from /127.0.0.1:38475
[junit] 2017-04-05 15:28:38,543 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11221:NIOServerCnxn@883] - Processing 
stat command from /127.0.0.1:38475
[junit] 2017-04-05 15:28:38,544 [myid:] - INFO  
[Thread-4:NIOServerCnxn$StatCommand@674] - Stat command output
[junit] 2017-04-05 15:28:38,544 [myid:] - INFO  
[Thread-4:NIOServerCnxn@1044] - Closed socket connection for client 
/127.0.0.1:38475 (no session established for client)
[junit] 2017-04-05 15:28:38,544 [myid:] - INFO  [main:JMXEnv@230] - 
ensureParent:[InMemoryDataTree, StandaloneServer_port]
[junit] 2017-04-05 15:28:38,547 [myid:] - INFO  [main:JMXEnv@247] - 
expect:InMemoryDataTree
[junit] 2017-04-05 15:28:38,547 [myid:] - INFO  [main:JMXEnv@251] - 
found:InMemoryDataTree 
org.apache.ZooKeeperService:name0=StandaloneServer_port11221,name1=InMemoryDataTree
[junit] 2017-04-05 15:28:38,547 [myid:] - INFO  [main:JMXEnv@247] - 
expect:StandaloneServer_port
[junit] 2017-04-05 15:28:38,547 [myid:] - INFO  [main:JMXEnv@251] - 
found:StandaloneServer_port 
org.apache.ZooKeeperService:name0=StandaloneServer_port11221
[junit] 2017-04-05 15:28:38,548 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@58] - Memory used 35727
[junit] 2017-04-05 15:28:38,548 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@63] - Number of threads 20
[junit] 2017-04-05 15:28:38,548 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@78] - FINISHED TEST METHOD testQuota
[junit] 2017-04-05 15:28:38,548 [myid:] - INFO  [main:ClientBase@522] - 
tearDown starting
[junit] 2017-04-05 15:28:38,602 [myid:] - INFO  [main:ZooKeeper@684] - 
Session: 0x15b3ebb5cee closed
[junit] 2017-04-05 15:28:38,602 [myid:] - INFO  [main:ClientBase@492] - 
STOPPING server
[junit] 2017-04-05 15:28:38,602 [myid:] - INFO  
[main-EventThread:ClientCnxn$EventThread@519] - EventThread shut down for 
session: 0x15b3ebb5cee
[junit] 2017-04-05 15:28:38,603 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:11221:NIOServerCnxnFactory@219] - 
NIOServerCnxn factory exited run method
[junit] 2017-04-05 15:28:38,603 [myid:] - INFO  [main:ZooKeeperServer@505] 
- shutting down
[junit] 2017-04-05 15:28:38,603 [myid:] - ERROR [main:ZooKeeperServer@472] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-04-05 15:2

ZooKeeper-trunk-openjdk7 - Build # 1427 - Still Failing

2017-04-05 Thread Apache Jenkins Server
See https://builds.apache.org/job/ZooKeeper-trunk-openjdk7/1427/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 63.55 MB...]
[junit] at 
org.jboss.netty.channel.socket.nio.AbstractNioWorker.write0(AbstractNioWorker.java:201)
[junit] at 
org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromTaskLoop(AbstractNioWorker.java:151)
[junit] at 
org.jboss.netty.channel.socket.nio.AbstractNioChannel$WriteTask.run(AbstractNioChannel.java:315)
[junit] at 
org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:391)
[junit] at 
org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:315)
[junit] at 
org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
[junit] at 
org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
[junit] at 
org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
[junit] at 
org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
[junit] at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[junit] at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[junit] at java.lang.Thread.run(Thread.java:745)
[junit] 2017-04-05 20:10:26,037 [myid:] - INFO  
[SyncThread:0:MBeanRegistry@128] - Unregister MBean 
[org.apache.ZooKeeperService:name0=StandaloneServer_port11468,name1=Connections,name2=127.0.0.1,name3=0x100fc1a11b1]
[junit] 2017-04-05 20:10:26,103 [myid:127.0.0.1:11222] - INFO  
[main-SendThread(127.0.0.1:11222):ClientCnxn$SendThread@1113] - Opening socket 
connection to server 127.0.0.1/127.0.0.1:11222. Will not attempt to 
authenticate using SASL (unknown error)
[junit] 2017-04-05 20:10:26,103 [myid:127.0.0.1:11222] - WARN  
[main-SendThread(127.0.0.1:11222):ClientCnxn$SendThread@1235] - Session 
0x100fc134968 for server 127.0.0.1/127.0.0.1:11222, unexpected error, 
closing socket connection and attempting reconnect
[junit] java.net.ConnectException: Connection refused
[junit] at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
[junit] at 
sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
[junit] at 
org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:357)
[junit] at 
org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1214)
[junit] 2017-04-05 20:10:26,137 [myid:] - INFO  [main:ZooKeeper@1324] - 
Session: 0x100fc1a11b1 closed
[junit] 2017-04-05 20:10:26,137 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@82] - Memory used 90517
[junit] 2017-04-05 20:10:26,138 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@87] - Number of threads 467
[junit] 2017-04-05 20:10:26,138 [myid:] - INFO  
[main:JUnit4ZKTestRunner$LoggedInvokeMethod@102] - FINISHED TEST METHOD 
testWatcherAutoResetWithLocal
[junit] 2017-04-05 20:10:26,137 [myid:] - INFO  
[main-EventThread:ClientCnxn$EventThread@513] - EventThread shut down for 
session: 0x100fc1a11b1
[junit] 2017-04-05 20:10:26,138 [myid:] - INFO  [main:ClientBase@558] - 
tearDown starting
[junit] 2017-04-05 20:10:26,138 [myid:] - INFO  [main:ClientBase@528] - 
STOPPING server
[junit] 2017-04-05 20:10:26,138 [myid:] - INFO  
[main:NettyServerCnxnFactory@464] - shutdown called 0.0.0.0/0.0.0.0:11468
[junit] 2017-04-05 20:10:26,140 [myid:] - INFO  [main:ZooKeeperServer@542] 
- shutting down
[junit] 2017-04-05 20:10:26,140 [myid:] - ERROR [main:ZooKeeperServer@506] 
- ZKShutdownHandler is not registered, so ZooKeeper server won't take any 
action on ERROR or SHUTDOWN server state changes
[junit] 2017-04-05 20:10:26,140 [myid:] - INFO  
[main:SessionTrackerImpl@232] - Shutting down
[junit] 2017-04-05 20:10:26,140 [myid:] - INFO  
[main:PrepRequestProcessor@1008] - Shutting down
[junit] 2017-04-05 20:10:26,140 [myid:] - INFO  
[main:SyncRequestProcessor@191] - Shutting down
[junit] 2017-04-05 20:10:26,140 [myid:] - INFO  [ProcessThread(sid:0 
cport:11468)::PrepRequestProcessor@157] - PrepRequestProcessor exited loop!
[junit] 2017-04-05 20:10:26,140 [myid:] - INFO  
[SyncThread:0:SyncRequestProcessor@169] - SyncRequestProcessor exited!
[junit] 2017-04-05 20:10:26,141 [myid:] - INFO  
[main:FinalRequestProcessor@481] - shutdown of request processor complete
[junit] 2017-04-05 20:10:26,141 [myid:] - INFO  [main:MBeanRegistry@128] - 
Unregister MBean 
[org.apache.ZooKeeperService:name0=StandaloneServer_port11468,name1=InMemoryDataTree]
[junit] 2017-04-05 20:10:26,141 [myid:] - INFO  [main:MBeanRegistry@128] - 
Unregister MBean [org.apache.ZooKeeperService:name0=StandaloneServer_port11468]
[jun

[GitHub] zookeeper pull request #184: ZOOKEEPER-236: SSL Support for Atomic Broadcast...

2017-04-05 Thread hanm
Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110057806
  
--- Diff: src/java/main/org/apache/zookeeper/common/X509UtilTest.java ---
@@ -0,0 +1,231 @@
+/**
--- End diff --

This is supposed to be a test file, right? If so, test file should be under 
src/test folder. Does this even build?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-236) SSL Support for Atomic Broadcast protocol

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-236:
--

Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110057806
  
--- Diff: src/java/main/org/apache/zookeeper/common/X509UtilTest.java ---
@@ -0,0 +1,231 @@
+/**
--- End diff --

This is supposed to be a test file, right? If so, test file should be under 
src/test folder. Does this even build?


> SSL Support for Atomic Broadcast protocol
> -
>
> Key: ZOOKEEPER-236
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-236
> Project: ZooKeeper
>  Issue Type: New Feature
>  Components: quorum, server
>Reporter: Benjamin Reed
>Assignee: Abraham Fine
>Priority: Minor
>
> We should have the ability to use SSL to authenticate and encrypt the traffic 
> between ZooKeeper servers. For the most part this is a very easy change. We 
> would probably only want to support this for TCP based leader elections.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #184: ZOOKEEPER-236: SSL Support for Atomic Broadcast...

2017-04-05 Thread hanm
Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110057980
  
--- Diff: src/java/main/org/apache/zookeeper/common/X509UtilTest.java ---
@@ -0,0 +1,231 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zookeeper.common;
+
+import org.apache.zookeeper.ZKTestCase;
+import org.apache.zookeeper.client.ZKClientConfig;
+import org.apache.zookeeper.server.ServerCnxnFactory;
+import org.bouncycastle.asn1.x500.X500NameBuilder;
+import org.bouncycastle.asn1.x500.style.BCStyle;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.KeyUsage;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocket;
+import java.io.FileOutputStream;
+import java.math.BigInteger;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Random;
+
+import static org.apache.zookeeper.test.ClientBase.createTmpDir;
+
+public class X509UtilTest extends ZKTestCase {
+
+private static final char[] PASSWORD = "password".toCharArray();
+private X509Certificate rootCertificate;
+
+private String truststorePath;
+private String keystorePath;
+private static KeyPair rootKeyPair;
+
+private X509Util x509Util;
+
+@BeforeClass
+public static void createKeyPair() throws Exception {
+Security.addProvider(new BouncyCastleProvider());
+KeyPairGenerator keyPairGenerator = 
KeyPairGenerator.getInstance("RSA", BouncyCastleProvider.PROVIDER_NAME);
+keyPairGenerator.initialize(4096);
+rootKeyPair = keyPairGenerator.genKeyPair();
+}
+
+@AfterClass
+public static void removeBouncyCastleProvider() throws Exception {
+Security.removeProvider("BC");
+}
+
+@Before
+public void setUp() throws Exception {
+rootCertificate = createSelfSignedCertifcate(rootKeyPair);
+
+String tmpDir = createTmpDir().getAbsolutePath();
+truststorePath = tmpDir + "/truststore.jks";
+keystorePath = tmpDir + "/keystore.jks";
+
+x509Util = new ClientX509Util();
+
+writeKeystore(rootCertificate, rootKeyPair, keystorePath);
+
+
System.setProperty(ServerCnxnFactory.ZOOKEEPER_SERVER_CNXN_FACTORY, 
"org.apache.zookeeper.server.NettyServerCnxnFactory");
+System.setProperty(ZKClientConfig.ZOOKEEPER_CLIENT_CNXN_SOCKET, 
"org.apache.zookeeper.ClientCnxnSocketNetty");
+System.setProperty(x509Util.getSslKeystoreLocationProperty(), 
keystorePath);
+System.setProperty(x509Util.getSslKeystorePasswdProperty(), new 
String(PASSWORD));
+System.setProperty(x509Util.getSslTruststoreLocationProperty(), 
truststorePath);
+System.setProperty(x509Util.getSslTruststorePasswdProperty(), new 
String(PASSWORD));
+
System.setProperty(x509Util.getSslHostnameVerificationEnabledProperty(), 
"false");
+
+writeTrustStore(PASSWORD);
+}
+
+private void writeKeystore(X509Certificate certificate, KeyPair 
keyPair, Strin

[jira] [Commented] (ZOOKEEPER-236) SSL Support for Atomic Broadcast protocol

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-236:
--

Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110057980
  
--- Diff: src/java/main/org/apache/zookeeper/common/X509UtilTest.java ---
@@ -0,0 +1,231 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zookeeper.common;
+
+import org.apache.zookeeper.ZKTestCase;
+import org.apache.zookeeper.client.ZKClientConfig;
+import org.apache.zookeeper.server.ServerCnxnFactory;
+import org.bouncycastle.asn1.x500.X500NameBuilder;
+import org.bouncycastle.asn1.x500.style.BCStyle;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.KeyUsage;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocket;
+import java.io.FileOutputStream;
+import java.math.BigInteger;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Random;
+
+import static org.apache.zookeeper.test.ClientBase.createTmpDir;
+
+public class X509UtilTest extends ZKTestCase {
+
+private static final char[] PASSWORD = "password".toCharArray();
+private X509Certificate rootCertificate;
+
+private String truststorePath;
+private String keystorePath;
+private static KeyPair rootKeyPair;
+
+private X509Util x509Util;
+
+@BeforeClass
+public static void createKeyPair() throws Exception {
+Security.addProvider(new BouncyCastleProvider());
+KeyPairGenerator keyPairGenerator = 
KeyPairGenerator.getInstance("RSA", BouncyCastleProvider.PROVIDER_NAME);
+keyPairGenerator.initialize(4096);
+rootKeyPair = keyPairGenerator.genKeyPair();
+}
+
+@AfterClass
+public static void removeBouncyCastleProvider() throws Exception {
+Security.removeProvider("BC");
+}
+
+@Before
+public void setUp() throws Exception {
+rootCertificate = createSelfSignedCertifcate(rootKeyPair);
+
+String tmpDir = createTmpDir().getAbsolutePath();
+truststorePath = tmpDir + "/truststore.jks";
+keystorePath = tmpDir + "/keystore.jks";
+
+x509Util = new ClientX509Util();
+
+writeKeystore(rootCertificate, rootKeyPair, keystorePath);
+
+
System.setProperty(ServerCnxnFactory.ZOOKEEPER_SERVER_CNXN_FACTORY, 
"org.apache.zookeeper.server.NettyServerCnxnFactory");
+System.setProperty(ZKClientConfig.ZOOKEEPER_CLIENT_CNXN_SOCKET, 
"org.apache.zookeeper.ClientCnxnSocketNetty");
+System.setProperty(x509Util.getSslKeystoreLocationProperty(), 
keystorePath);
+System.setProperty(x509Util.getSslKeystorePasswdProperty(), new 
String(PASSWORD));
+System.setProperty(x509Util.getSslTruststoreLocationProperty(), 
truststorePath);
+System.setProperty(x509Util.getSslTruststorePasswdProperty(), new 
Str

[jira] [Commented] (ZOOKEEPER-2604) Temporary node has not been deleted

2017-04-05 Thread sunqb (JIRA)

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

sunqb commented on ZOOKEEPER-2604:
--

this error because i change system time

> Temporary node has not been deleted
> ---
>
> Key: ZOOKEEPER-2604
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2604
> Project: ZooKeeper
>  Issue Type: Bug
>Affects Versions: 3.4.6
> Environment: linux centos , jdk7
>Reporter: sunqb
> Fix For: 3.4.6
>
>
> i use zkclient to connect zookeeper-server , but sometime when i close my 
> zkclient ,the Temporary node can't be deleted。i have search this bug,and i 
> fixed it by delete the data dir



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #184: ZOOKEEPER-236: SSL Support for Atomic Broadcast...

2017-04-05 Thread hanm
Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110060745
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Observer.java ---
@@ -63,10 +63,10 @@ void observeLeader() throws Exception {
 zk.registerJMX(new ObserverBean(this, zk), self.jmxLocalPeerBean);
 
 try {
-InetSocketAddress addr = findLeader();
--- End diff --

I am not sure what this change of addr from type InetSocketAddress to 
QuorumServer is for. I may miss something though.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-236) SSL Support for Atomic Broadcast protocol

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-236:
--

Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110060745
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Observer.java ---
@@ -63,10 +63,10 @@ void observeLeader() throws Exception {
 zk.registerJMX(new ObserverBean(this, zk), self.jmxLocalPeerBean);
 
 try {
-InetSocketAddress addr = findLeader();
--- End diff --

I am not sure what this change of addr from type InetSocketAddress to 
QuorumServer is for. I may miss something though.


> SSL Support for Atomic Broadcast protocol
> -
>
> Key: ZOOKEEPER-236
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-236
> Project: ZooKeeper
>  Issue Type: New Feature
>  Components: quorum, server
>Reporter: Benjamin Reed
>Assignee: Abraham Fine
>Priority: Minor
>
> We should have the ability to use SSL to authenticate and encrypt the traffic 
> between ZooKeeper servers. For the most part this is a very easy change. We 
> would probably only want to support this for TCP based leader elections.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #184: ZOOKEEPER-236: SSL Support for Atomic Broadcast...

2017-04-05 Thread hanm
Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110060990
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Learner.java ---
@@ -193,21 +198,18 @@ void request(Request request) throws IOException {
 /**
  * Returns the address of the node we think is the leader.
  */
-protected InetSocketAddress findLeader() {
+protected QuorumServer findLeader() {
--- End diff --

Not sure why findLeader is returning a QuorumServer instead of 
InetSocketAddress? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-236) SSL Support for Atomic Broadcast protocol

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-236:
--

Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110060990
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Learner.java ---
@@ -193,21 +198,18 @@ void request(Request request) throws IOException {
 /**
  * Returns the address of the node we think is the leader.
  */
-protected InetSocketAddress findLeader() {
+protected QuorumServer findLeader() {
--- End diff --

Not sure why findLeader is returning a QuorumServer instead of 
InetSocketAddress? 


> SSL Support for Atomic Broadcast protocol
> -
>
> Key: ZOOKEEPER-236
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-236
> Project: ZooKeeper
>  Issue Type: New Feature
>  Components: quorum, server
>Reporter: Benjamin Reed
>Assignee: Abraham Fine
>Priority: Minor
>
> We should have the ability to use SSL to authenticate and encrypt the traffic 
> between ZooKeeper servers. For the most part this is a very easy change. We 
> would probably only want to support this for TCP based leader elections.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-236) SSL Support for Atomic Broadcast protocol

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-236:
--

Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110061068
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Learner.java ---
@@ -253,7 +255,10 @@ protected void connectToLeader(InetSocketAddress addr)
 throw new IOException("initLimit exceeded on 
retries.");
 }
 
-sockConnect(sock, addr, Math.min(self.tickTime * 
self.syncLimit, remainingInitLimitTime));
+sockConnect(sock, leader.addr, Math.min(self.tickTime * 
self.syncLimit, remainingInitLimitTime));
--- End diff --

leader could be null in leader.addr right? Still wondering why change the 
leader type from an address to a QuorumServer.


> SSL Support for Atomic Broadcast protocol
> -
>
> Key: ZOOKEEPER-236
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-236
> Project: ZooKeeper
>  Issue Type: New Feature
>  Components: quorum, server
>Reporter: Benjamin Reed
>Assignee: Abraham Fine
>Priority: Minor
>
> We should have the ability to use SSL to authenticate and encrypt the traffic 
> between ZooKeeper servers. For the most part this is a very easy change. We 
> would probably only want to support this for TCP based leader elections.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #184: ZOOKEEPER-236: SSL Support for Atomic Broadcast...

2017-04-05 Thread hanm
Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110061068
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Learner.java ---
@@ -253,7 +255,10 @@ protected void connectToLeader(InetSocketAddress addr)
 throw new IOException("initLimit exceeded on 
retries.");
 }
 
-sockConnect(sock, addr, Math.min(self.tickTime * 
self.syncLimit, remainingInitLimitTime));
+sockConnect(sock, leader.addr, Math.min(self.tickTime * 
self.syncLimit, remainingInitLimitTime));
--- End diff --

leader could be null in leader.addr right? Still wondering why change the 
leader type from an address to a QuorumServer.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] zookeeper pull request #184: ZOOKEEPER-236: SSL Support for Atomic Broadcast...

2017-04-05 Thread hanm
Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110061229
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Learner.java ---
@@ -230,15 +232,15 @@ protected void sockConnect(Socket sock, 
InetSocketAddress addr, int timeout)
 /**
  * Establish a connection with the Leader found by findLeader. Retries
  * until either initLimit time has elapsed or 5 tries have happened. 
- * @param addr - the address of the Leader to connect to.
+ * @param leader - the QuorumServer elected leader
  * @throws IOException - if the socket connection fails on the 5th 
attempt
  * @throws ConnectException
  * @throws InterruptedException
  */
-protected void connectToLeader(InetSocketAddress addr) 
-throws IOException, ConnectException, InterruptedException {
-sock = new Socket();
-sock.setSoTimeout(self.tickTime * self.initLimit);
+protected void connectToLeader(QuorumServer leader)
+throws IOException, InterruptedException, X509Exception {
+QuorumX509Util quorumX509Util = new QuorumX509Util();
--- End diff --

We now create QuorumX509Util whenever connectToLeader is called, even if 
ssl is not enabled. Could this be improved so the SSL related code path is only 
involved when ssl is enabled?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-236) SSL Support for Atomic Broadcast protocol

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-236:
--

Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110061229
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Learner.java ---
@@ -230,15 +232,15 @@ protected void sockConnect(Socket sock, 
InetSocketAddress addr, int timeout)
 /**
  * Establish a connection with the Leader found by findLeader. Retries
  * until either initLimit time has elapsed or 5 tries have happened. 
- * @param addr - the address of the Leader to connect to.
+ * @param leader - the QuorumServer elected leader
  * @throws IOException - if the socket connection fails on the 5th 
attempt
  * @throws ConnectException
  * @throws InterruptedException
  */
-protected void connectToLeader(InetSocketAddress addr) 
-throws IOException, ConnectException, InterruptedException {
-sock = new Socket();
-sock.setSoTimeout(self.tickTime * self.initLimit);
+protected void connectToLeader(QuorumServer leader)
+throws IOException, InterruptedException, X509Exception {
+QuorumX509Util quorumX509Util = new QuorumX509Util();
--- End diff --

We now create QuorumX509Util whenever connectToLeader is called, even if 
ssl is not enabled. Could this be improved so the SSL related code path is only 
involved when ssl is enabled?


> SSL Support for Atomic Broadcast protocol
> -
>
> Key: ZOOKEEPER-236
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-236
> Project: ZooKeeper
>  Issue Type: New Feature
>  Components: quorum, server
>Reporter: Benjamin Reed
>Assignee: Abraham Fine
>Priority: Minor
>
> We should have the ability to use SSL to authenticate and encrypt the traffic 
> between ZooKeeper servers. For the most part this is a very easy change. We 
> would probably only want to support this for TCP based leader elections.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #184: ZOOKEEPER-236: SSL Support for Atomic Broadcast...

2017-04-05 Thread afine
Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110068698
  
--- Diff: src/java/main/org/apache/zookeeper/common/X509UtilTest.java ---
@@ -0,0 +1,231 @@
+/**
--- End diff --

Whoops... Fixed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-236) SSL Support for Atomic Broadcast protocol

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-236:
--

Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110068698
  
--- Diff: src/java/main/org/apache/zookeeper/common/X509UtilTest.java ---
@@ -0,0 +1,231 @@
+/**
--- End diff --

Whoops... Fixed.


> SSL Support for Atomic Broadcast protocol
> -
>
> Key: ZOOKEEPER-236
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-236
> Project: ZooKeeper
>  Issue Type: New Feature
>  Components: quorum, server
>Reporter: Benjamin Reed
>Assignee: Abraham Fine
>Priority: Minor
>
> We should have the ability to use SSL to authenticate and encrypt the traffic 
> between ZooKeeper servers. For the most part this is a very easy change. We 
> would probably only want to support this for TCP based leader elections.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-236) SSL Support for Atomic Broadcast protocol

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-236:
--

Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110068782
  
--- Diff: src/java/main/org/apache/zookeeper/common/X509UtilTest.java ---
@@ -0,0 +1,231 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zookeeper.common;
+
+import org.apache.zookeeper.ZKTestCase;
+import org.apache.zookeeper.client.ZKClientConfig;
+import org.apache.zookeeper.server.ServerCnxnFactory;
+import org.bouncycastle.asn1.x500.X500NameBuilder;
+import org.bouncycastle.asn1.x500.style.BCStyle;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.KeyUsage;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocket;
+import java.io.FileOutputStream;
+import java.math.BigInteger;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Random;
+
+import static org.apache.zookeeper.test.ClientBase.createTmpDir;
+
+public class X509UtilTest extends ZKTestCase {
+
+private static final char[] PASSWORD = "password".toCharArray();
+private X509Certificate rootCertificate;
+
+private String truststorePath;
+private String keystorePath;
+private static KeyPair rootKeyPair;
+
+private X509Util x509Util;
+
+@BeforeClass
+public static void createKeyPair() throws Exception {
+Security.addProvider(new BouncyCastleProvider());
+KeyPairGenerator keyPairGenerator = 
KeyPairGenerator.getInstance("RSA", BouncyCastleProvider.PROVIDER_NAME);
+keyPairGenerator.initialize(4096);
+rootKeyPair = keyPairGenerator.genKeyPair();
+}
+
+@AfterClass
+public static void removeBouncyCastleProvider() throws Exception {
+Security.removeProvider("BC");
+}
+
+@Before
+public void setUp() throws Exception {
+rootCertificate = createSelfSignedCertifcate(rootKeyPair);
+
+String tmpDir = createTmpDir().getAbsolutePath();
+truststorePath = tmpDir + "/truststore.jks";
+keystorePath = tmpDir + "/keystore.jks";
+
+x509Util = new ClientX509Util();
+
+writeKeystore(rootCertificate, rootKeyPair, keystorePath);
+
+
System.setProperty(ServerCnxnFactory.ZOOKEEPER_SERVER_CNXN_FACTORY, 
"org.apache.zookeeper.server.NettyServerCnxnFactory");
+System.setProperty(ZKClientConfig.ZOOKEEPER_CLIENT_CNXN_SOCKET, 
"org.apache.zookeeper.ClientCnxnSocketNetty");
+System.setProperty(x509Util.getSslKeystoreLocationProperty(), 
keystorePath);
+System.setProperty(x509Util.getSslKeystorePasswdProperty(), new 
String(PASSWORD));
+System.setProperty(x509Util.getSslTruststoreLocationProperty(), 
truststorePath);
+System.setProperty(x509Util.getSslTruststorePasswdProperty(), new 
St

[GitHub] zookeeper pull request #184: ZOOKEEPER-236: SSL Support for Atomic Broadcast...

2017-04-05 Thread afine
Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110068782
  
--- Diff: src/java/main/org/apache/zookeeper/common/X509UtilTest.java ---
@@ -0,0 +1,231 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zookeeper.common;
+
+import org.apache.zookeeper.ZKTestCase;
+import org.apache.zookeeper.client.ZKClientConfig;
+import org.apache.zookeeper.server.ServerCnxnFactory;
+import org.bouncycastle.asn1.x500.X500NameBuilder;
+import org.bouncycastle.asn1.x500.style.BCStyle;
+import org.bouncycastle.asn1.x509.BasicConstraints;
+import org.bouncycastle.asn1.x509.Extension;
+import org.bouncycastle.asn1.x509.KeyUsage;
+import org.bouncycastle.cert.X509v3CertificateBuilder;
+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
+import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.operator.ContentSigner;
+import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocket;
+import java.io.FileOutputStream;
+import java.math.BigInteger;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.KeyStore;
+import java.security.Security;
+import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Random;
+
+import static org.apache.zookeeper.test.ClientBase.createTmpDir;
+
+public class X509UtilTest extends ZKTestCase {
+
+private static final char[] PASSWORD = "password".toCharArray();
+private X509Certificate rootCertificate;
+
+private String truststorePath;
+private String keystorePath;
+private static KeyPair rootKeyPair;
+
+private X509Util x509Util;
+
+@BeforeClass
+public static void createKeyPair() throws Exception {
+Security.addProvider(new BouncyCastleProvider());
+KeyPairGenerator keyPairGenerator = 
KeyPairGenerator.getInstance("RSA", BouncyCastleProvider.PROVIDER_NAME);
+keyPairGenerator.initialize(4096);
+rootKeyPair = keyPairGenerator.genKeyPair();
+}
+
+@AfterClass
+public static void removeBouncyCastleProvider() throws Exception {
+Security.removeProvider("BC");
+}
+
+@Before
+public void setUp() throws Exception {
+rootCertificate = createSelfSignedCertifcate(rootKeyPair);
+
+String tmpDir = createTmpDir().getAbsolutePath();
+truststorePath = tmpDir + "/truststore.jks";
+keystorePath = tmpDir + "/keystore.jks";
+
+x509Util = new ClientX509Util();
+
+writeKeystore(rootCertificate, rootKeyPair, keystorePath);
+
+
System.setProperty(ServerCnxnFactory.ZOOKEEPER_SERVER_CNXN_FACTORY, 
"org.apache.zookeeper.server.NettyServerCnxnFactory");
+System.setProperty(ZKClientConfig.ZOOKEEPER_CLIENT_CNXN_SOCKET, 
"org.apache.zookeeper.ClientCnxnSocketNetty");
+System.setProperty(x509Util.getSslKeystoreLocationProperty(), 
keystorePath);
+System.setProperty(x509Util.getSslKeystorePasswdProperty(), new 
String(PASSWORD));
+System.setProperty(x509Util.getSslTruststoreLocationProperty(), 
truststorePath);
+System.setProperty(x509Util.getSslTruststorePasswdProperty(), new 
String(PASSWORD));
+
System.setProperty(x509Util.getSslHostnameVerificationEnabledProperty(), 
"false");
+
+writeTrustStore(PASSWORD);
+}
+
+private void writeKeystore(X509Certificate certificate, KeyPair 
keyPair, Stri

[GitHub] zookeeper pull request #184: ZOOKEEPER-236: SSL Support for Atomic Broadcast...

2017-04-05 Thread afine
Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110068829
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Learner.java ---
@@ -193,21 +198,18 @@ void request(Request request) throws IOException {
 /**
  * Returns the address of the node we think is the leader.
  */
-protected InetSocketAddress findLeader() {
+protected QuorumServer findLeader() {
--- End diff --

Egah, this is a change from an earlier iteration that I forgot to remove. 
Fixed now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-236) SSL Support for Atomic Broadcast protocol

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-236:
--

Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110068870
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Learner.java ---
@@ -253,7 +255,10 @@ protected void connectToLeader(InetSocketAddress addr)
 throw new IOException("initLimit exceeded on 
retries.");
 }
 
-sockConnect(sock, addr, Math.min(self.tickTime * 
self.syncLimit, remainingInitLimitTime));
+sockConnect(sock, leader.addr, Math.min(self.tickTime * 
self.syncLimit, remainingInitLimitTime));
--- End diff --

This should be fixed.


> SSL Support for Atomic Broadcast protocol
> -
>
> Key: ZOOKEEPER-236
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-236
> Project: ZooKeeper
>  Issue Type: New Feature
>  Components: quorum, server
>Reporter: Benjamin Reed
>Assignee: Abraham Fine
>Priority: Minor
>
> We should have the ability to use SSL to authenticate and encrypt the traffic 
> between ZooKeeper servers. For the most part this is a very easy change. We 
> would probably only want to support this for TCP based leader elections.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ZOOKEEPER-236) SSL Support for Atomic Broadcast protocol

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-236:
--

Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110068829
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Learner.java ---
@@ -193,21 +198,18 @@ void request(Request request) throws IOException {
 /**
  * Returns the address of the node we think is the leader.
  */
-protected InetSocketAddress findLeader() {
+protected QuorumServer findLeader() {
--- End diff --

Egah, this is a change from an earlier iteration that I forgot to remove. 
Fixed now.


> SSL Support for Atomic Broadcast protocol
> -
>
> Key: ZOOKEEPER-236
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-236
> Project: ZooKeeper
>  Issue Type: New Feature
>  Components: quorum, server
>Reporter: Benjamin Reed
>Assignee: Abraham Fine
>Priority: Minor
>
> We should have the ability to use SSL to authenticate and encrypt the traffic 
> between ZooKeeper servers. For the most part this is a very easy change. We 
> would probably only want to support this for TCP based leader elections.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #184: ZOOKEEPER-236: SSL Support for Atomic Broadcast...

2017-04-05 Thread afine
Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110068870
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Learner.java ---
@@ -253,7 +255,10 @@ protected void connectToLeader(InetSocketAddress addr)
 throw new IOException("initLimit exceeded on 
retries.");
 }
 
-sockConnect(sock, addr, Math.min(self.tickTime * 
self.syncLimit, remainingInitLimitTime));
+sockConnect(sock, leader.addr, Math.min(self.tickTime * 
self.syncLimit, remainingInitLimitTime));
--- End diff --

This should be fixed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Failed: ZOOKEEPER- PreCommit Build #504

2017-04-05 Thread Apache Jenkins Server
Build: https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/504/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 70.03 MB...]
 [exec] +1 tests included.  The patch appears to include 41 new or 
modified tests.
 [exec] 
 [exec] +1 javadoc.  The javadoc tool did not generate any warning 
messages.
 [exec] 
 [exec] +1 javac.  The applied patch does not increase the total number 
of javac compiler warnings.
 [exec] 
 [exec] -1 findbugs.  The patch appears to introduce 4 new Findbugs 
(version 3.0.1) warnings.
 [exec] 
 [exec] +1 release audit.  The applied patch does not increase the 
total number of release audit warnings.
 [exec] 
 [exec] -1 core tests.  The patch failed core unit tests.
 [exec] 
 [exec] +1 contrib tests.  The patch passed contrib unit tests.
 [exec] 
 [exec] Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/504//testReport/
 [exec] Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/504//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
 [exec] Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/504//console
 [exec] 
 [exec] This message is automatically generated.
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Adding comment to Jira.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] Comment added.
 [exec] 7507f5ff7daf075e2f69cd04f58fe2a3ba1563d0 logged out
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Finished build.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] mv: 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 and 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 are the same file

BUILD FAILED
/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/build.xml:1642:
 exec returned: 2

Total time: 13 minutes 36 seconds
Build step 'Execute shell' marked build as failure
Archiving artifacts
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Recording test results
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
[description-setter] Description set: ZOOKEEPER-236
Putting comment on the pull request
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7



###
## FAILED TESTS (if any) 
##
1 tests failed.
FAILED:  
org.apache.zookeeper.server.quorum.UnifiedServerSocketTest.testConnectWithoutSSL

Error Message:
Connection refused

Stack Trace:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:198)
at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at 
org.apache.zookeeper.server.quorum.UnifiedServerSocketTest.testConnectWithoutSSL(UnifiedServerSocketTest.java:122)




[jira] [Commented] (ZOOKEEPER-236) SSL Support for Atomic Broadcast protocol

2017-04-05 Thread Hadoop QA (JIRA)

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

Hadoop QA commented on ZOOKEEPER-236:
-

-1 overall.  GitHub Pull Request  Build
  

+1 @author.  The patch does not contain any @author tags.

+1 tests included.  The patch appears to include 41 new or modified tests.

+1 javadoc.  The javadoc tool did not generate any warning messages.

+1 javac.  The applied patch does not increase the total number of javac 
compiler warnings.

-1 findbugs.  The patch appears to introduce 4 new Findbugs (version 3.0.1) 
warnings.

+1 release audit.  The applied patch does not increase the total number of 
release audit warnings.

-1 core tests.  The patch failed core unit tests.

+1 contrib tests.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/504//testReport/
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/504//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/504//console

This message is automatically generated.

> SSL Support for Atomic Broadcast protocol
> -
>
> Key: ZOOKEEPER-236
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-236
> Project: ZooKeeper
>  Issue Type: New Feature
>  Components: quorum, server
>Reporter: Benjamin Reed
>Assignee: Abraham Fine
>Priority: Minor
>
> We should have the ability to use SSL to authenticate and encrypt the traffic 
> between ZooKeeper servers. For the most part this is a very easy change. We 
> would probably only want to support this for TCP based leader elections.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (ZOOKEEPER-1859) pwriter should be closed in NIOServerCnxn#checkFourLetterWord()

2017-04-05 Thread Ted Yu (JIRA)

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

Ted Yu updated ZOOKEEPER-1859:
--
Description: 
{code}
final PrintWriter pwriter = new PrintWriter(
new BufferedWriter(new SendBufferWriter()));
...
} else if (len == telnetCloseCmd) {
cleanupWriterSocket(null);
return true;
}
{code}

pwriter should be closed in case of telnetCloseCmd

  was:
{code}
final PrintWriter pwriter = new PrintWriter(
new BufferedWriter(new SendBufferWriter()));
...
} else if (len == telnetCloseCmd) {
cleanupWriterSocket(null);
return true;
}
{code}
pwriter should be closed in case of telnetCloseCmd


> pwriter should be closed in NIOServerCnxn#checkFourLetterWord()
> ---
>
> Key: ZOOKEEPER-1859
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1859
> Project: ZooKeeper
>  Issue Type: Bug
>Reporter: Ted Yu
>Priority: Minor
>
> {code}
> final PrintWriter pwriter = new PrintWriter(
> new BufferedWriter(new SendBufferWriter()));
> ...
> } else if (len == telnetCloseCmd) {
> cleanupWriterSocket(null);
> return true;
> }
> {code}
> pwriter should be closed in case of telnetCloseCmd



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #184: ZOOKEEPER-236: SSL Support for Atomic Broadcast...

2017-04-05 Thread afine
Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110070800
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Learner.java ---
@@ -230,15 +232,15 @@ protected void sockConnect(Socket sock, 
InetSocketAddress addr, int timeout)
 /**
  * Establish a connection with the Leader found by findLeader. Retries
  * until either initLimit time has elapsed or 5 tries have happened. 
- * @param addr - the address of the Leader to connect to.
+ * @param leader - the QuorumServer elected leader
  * @throws IOException - if the socket connection fails on the 5th 
attempt
  * @throws ConnectException
  * @throws InterruptedException
  */
-protected void connectToLeader(InetSocketAddress addr) 
-throws IOException, ConnectException, InterruptedException {
-sock = new Socket();
-sock.setSoTimeout(self.tickTime * self.initLimit);
+protected void connectToLeader(QuorumServer leader)
+throws IOException, InterruptedException, X509Exception {
+QuorumX509Util quorumX509Util = new QuorumX509Util();
--- End diff --

Agreed. Fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-236) SSL Support for Atomic Broadcast protocol

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-236:
--

Github user afine commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/184#discussion_r110070800
  
--- Diff: src/java/main/org/apache/zookeeper/server/quorum/Learner.java ---
@@ -230,15 +232,15 @@ protected void sockConnect(Socket sock, 
InetSocketAddress addr, int timeout)
 /**
  * Establish a connection with the Leader found by findLeader. Retries
  * until either initLimit time has elapsed or 5 tries have happened. 
- * @param addr - the address of the Leader to connect to.
+ * @param leader - the QuorumServer elected leader
  * @throws IOException - if the socket connection fails on the 5th 
attempt
  * @throws ConnectException
  * @throws InterruptedException
  */
-protected void connectToLeader(InetSocketAddress addr) 
-throws IOException, ConnectException, InterruptedException {
-sock = new Socket();
-sock.setSoTimeout(self.tickTime * self.initLimit);
+protected void connectToLeader(QuorumServer leader)
+throws IOException, InterruptedException, X509Exception {
+QuorumX509Util quorumX509Util = new QuorumX509Util();
--- End diff --

Agreed. Fixed


> SSL Support for Atomic Broadcast protocol
> -
>
> Key: ZOOKEEPER-236
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-236
> Project: ZooKeeper
>  Issue Type: New Feature
>  Components: quorum, server
>Reporter: Benjamin Reed
>Assignee: Abraham Fine
>Priority: Minor
>
> We should have the ability to use SSL to authenticate and encrypt the traffic 
> between ZooKeeper servers. For the most part this is a very easy change. We 
> would probably only want to support this for TCP based leader elections.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


Failed: ZOOKEEPER- PreCommit Build #505

2017-04-05 Thread Apache Jenkins Server
Build: https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/505/

###
## LAST 60 LINES OF THE CONSOLE 
###
[...truncated 69.69 MB...]
 [exec] +1 tests included.  The patch appears to include 41 new or 
modified tests.
 [exec] 
 [exec] +1 javadoc.  The javadoc tool did not generate any warning 
messages.
 [exec] 
 [exec] +1 javac.  The applied patch does not increase the total number 
of javac compiler warnings.
 [exec] 
 [exec] -1 findbugs.  The patch appears to introduce 4 new Findbugs 
(version 3.0.1) warnings.
 [exec] 
 [exec] +1 release audit.  The applied patch does not increase the 
total number of release audit warnings.
 [exec] 
 [exec] -1 core tests.  The patch failed core unit tests.
 [exec] 
 [exec] +1 contrib tests.  The patch passed contrib unit tests.
 [exec] 
 [exec] Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/505//testReport/
 [exec] Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/505//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
 [exec] Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/505//console
 [exec] 
 [exec] This message is automatically generated.
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Adding comment to Jira.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] Comment added.
 [exec] bd584d0592809ec60012a4de547c5242118dfbc8 logged out
 [exec] 
 [exec] 
 [exec] 
==
 [exec] 
==
 [exec] Finished build.
 [exec] 
==
 [exec] 
==
 [exec] 
 [exec] 
 [exec] mv: 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 and 
'/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/patchprocess'
 are the same file

BUILD FAILED
/home/jenkins/jenkins-slave/workspace/PreCommit-ZOOKEEPER-github-pr-build/build.xml:1642:
 exec returned: 2

Total time: 14 minutes 5 seconds
Build step 'Execute shell' marked build as failure
Archiving artifacts
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Recording test results
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
[description-setter] Description set: ZOOKEEPER-236
Putting comment on the pull request
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Email was triggered for: Failure - Any
Sending email for trigger: Failure - Any
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7
Setting JDK_1_7_LATEST__HOME=/home/jenkins/tools/java/latest1.7



###
## FAILED TESTS (if any) 
##
1 tests failed.
FAILED:  
org.apache.zookeeper.server.quorum.UnifiedServerSocketTest.testConnectWithoutSSL

Error Message:
Connection refused

Stack Trace:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:198)
at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at 
org.apache.zookeeper.server.quorum.UnifiedServerSocketTest.testConnectWithoutSSL(UnifiedServerSocketTest.java:122)




[jira] [Commented] (ZOOKEEPER-236) SSL Support for Atomic Broadcast protocol

2017-04-05 Thread Hadoop QA (JIRA)

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

Hadoop QA commented on ZOOKEEPER-236:
-

-1 overall.  GitHub Pull Request  Build
  

+1 @author.  The patch does not contain any @author tags.

+1 tests included.  The patch appears to include 41 new or modified tests.

+1 javadoc.  The javadoc tool did not generate any warning messages.

+1 javac.  The applied patch does not increase the total number of javac 
compiler warnings.

-1 findbugs.  The patch appears to introduce 4 new Findbugs (version 3.0.1) 
warnings.

+1 release audit.  The applied patch does not increase the total number of 
release audit warnings.

-1 core tests.  The patch failed core unit tests.

+1 contrib tests.  The patch passed contrib unit tests.

Test results: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/505//testReport/
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/505//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: 
https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/505//console

This message is automatically generated.

> SSL Support for Atomic Broadcast protocol
> -
>
> Key: ZOOKEEPER-236
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-236
> Project: ZooKeeper
>  Issue Type: New Feature
>  Components: quorum, server
>Reporter: Benjamin Reed
>Assignee: Abraham Fine
>Priority: Minor
>
> We should have the ability to use SSL to authenticate and encrypt the traffic 
> between ZooKeeper servers. For the most part this is a very easy change. We 
> would probably only want to support this for TCP based leader elections.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


Re: [VOTE] Apache ZooKeeper release 3.5.3-beta candidate 1

2017-04-05 Thread Mohammad Arshad
+1
Run all tests on Ubuntu 15.10 on java 7.
Built tar ball on Ubuntu and Windows.
Run releaseaudit
Generated documentation
Verified basic features, create znode,delete znode, get data, set data, get
acl, set acl etc.
Verified 4lw commands.
Verified CLI commands


On Mon, Apr 3, 2017 at 10:56 PM, Michael Han  wrote:

> Hi all,
>
> This is the second release candidate (RC1) of 3.5.3-beta, following the
> first release candidate (RC0) cut off last week [1]. It fixes incorrect
> Implementation-Version information contained in the manifest file of the
> generated artifacts. There is no code changes, just regenerated and
> resigned artifacts.
>
> The full release notes are available at:
>
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?
> projectId=12310801&version=12335444
>
>  Please download, test and vote by April 8th 2017, 23:59 UTC+0. 
>
> Source files:
> https://home.apache.org/~hanm/zookeeper/zookeeper-3.5.3-beta-rc1/
>
> Maven staging repo:
> https://repository.apache.org/content/groups/staging/org/
> apache/zookeeper/zookeeper/3.5.3-beta/
>
> The tag to be voted upon:
> *https://github.com/apache/zookeeper/tree/release-3.5.3-rc1
> *
>
> ZooKeeper's KEYS file containing PGP keys we use to sign the release:
> http://www.apache.org/dist/zookeeper/KEYS
>
> Should we release this candidate?
>
> [1]
> http://mail-archives.apache.org/mod_mbox/zookeeper-dev/201703.mbox/%3CCA%
> 2Bi0x1LTONuaT6H%2BiOHAT2O1SVPKnQzzQh8vKMzWJVijCrHUrw%40mail.gmail.com%3E
>
> --
> Cheers
> Michael.
>


[jira] [Commented] (ZOOKEEPER-2742) Few test cases of org.apache.zookeeper.ZooKeeperTest fails in Windows.

2017-04-05 Thread Mohammad Arshad (JIRA)

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

Mohammad Arshad commented on ZOOKEEPER-2742:


Windows is not fully supported by zookeeper, but it makes sense to fix these 
very obvious test failures.
[~a72877], are u willing to submit a fix.

> Few test cases of org.apache.zookeeper.ZooKeeperTest fails in Windows.
> --
>
> Key: ZOOKEEPER-2742
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2742
> Project: ZooKeeper
>  Issue Type: Test
>  Components: tests
> Environment: Windows
>Reporter: Abhishek Kumar
>Priority: Trivial
>
> Following test cases fail in Windows environment:
> 1. org.apache.zookeeper.ZooKeeperTest.testLsrRootCommand()
> 2. org.apache.zookeeper.ZooKeeperTest.testLsrCommand()
> It seems that failure is related to use of  "\n" (System dependent new line 
> char)in org.apache.zookeeper.ZooKeeperTest.runCommandExpect(CliCommand, 
> List)
> ..
> ..
>  String result = byteStream.toString();
> assertTrue(result, result.contains(
> StringUtils.joinStrings(expectedResults, "\n")));
> ..
> ..



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #211: ZOOKEEPER-2743: Netty connection leaks JMX conn...

2017-04-05 Thread rakeshadr
Github user rakeshadr commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/211#discussion_r110080170
  
--- Diff: src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java ---
@@ -87,6 +87,12 @@ public void close() {
 LOG.debug("close called for sessionid:0x"
 + Long.toHexString(sessionId));
 }
+
+// ZOOKEEPER-2743:
+// Always unregister connection upon close to prevent
+// connection bean leak under certain race conditions.
+factory.unregisterConnection(this);
--- End diff --

Any chance to occur another race condition, [1] session finalization is in 
progress [2] client cnxn closure due to server shutdown. Assume [1] step is in 
progress and not yet registered the connection bean [2] step is in progress and 
as per this patch unregistered bean irrespective of cnxn exists in factory and 
returns. Again assume now, [1] step continues and registering the connection 
bean. This is again leaking the cnxn bean, right?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-2743) Netty connection leaks JMX connection bean upon connection close in certain race conditions.

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2743:
---

Github user rakeshadr commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/211#discussion_r110080170
  
--- Diff: src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java ---
@@ -87,6 +87,12 @@ public void close() {
 LOG.debug("close called for sessionid:0x"
 + Long.toHexString(sessionId));
 }
+
+// ZOOKEEPER-2743:
+// Always unregister connection upon close to prevent
+// connection bean leak under certain race conditions.
+factory.unregisterConnection(this);
--- End diff --

Any chance to occur another race condition, [1] session finalization is in 
progress [2] client cnxn closure due to server shutdown. Assume [1] step is in 
progress and not yet registered the connection bean [2] step is in progress and 
as per this patch unregistered bean irrespective of cnxn exists in factory and 
returns. Again assume now, [1] step continues and registering the connection 
bean. This is again leaking the cnxn bean, right?


> Netty connection leaks JMX connection bean upon connection close in certain 
> race conditions.
> 
>
> Key: ZOOKEEPER-2743
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2743
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: server
>Affects Versions: 3.4.10, 3.5.2
>Reporter: Michael Han
>Assignee: Michael Han
>  Labels: netty
>
> This is a tricky issue found while debugging failure of "flaky" watcher test 
> (ZOOKEEPER-2686). When closing a Netty connection, depend on timing the 
> connection bean registered when the connection was provisioned might not get 
> unregistered, leading to leaked Java beans. 
> The race happens at the time when the client is in the process of finalizing 
> the session. As part of session finalization, a connection bean will be 
> registered [1]. But right before the registering bean, the connection might 
> gets closed, in cases for example the server that the client is connecting to 
> is shutdown. As part of connection close, the bean will be un-registered, as 
> expected [2], however the problem is when we execute at [2], the connection 
> bean might not finish registering at [1], so the unregister of bean is a NOP. 
> What's worse, as part of connection close, we remove this connection from 
> connection factory [3], so future connection close call will get short 
> circuited and directly return; in other words the bean unregister code in 
> connection close call will only get executed once. Depends on luck, the bean 
> might not get unregistered, as previously illustrated.
> [1] 
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java#L700
> [2] 
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java#L114
> [3] 
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java#L96



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #211: ZOOKEEPER-2743: Netty connection leaks JMX conn...

2017-04-05 Thread hanm
Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/211#discussion_r110081828
  
--- Diff: src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java ---
@@ -87,6 +87,12 @@ public void close() {
 LOG.debug("close called for sessionid:0x"
 + Long.toHexString(sessionId));
 }
+
+// ZOOKEEPER-2743:
+// Always unregister connection upon close to prevent
+// connection bean leak under certain race conditions.
+factory.unregisterConnection(this);
--- End diff --

That is fine, I might able to provide a formal verification of the theorem 
but here is a quick prove of that case:
* Assume close is called before connection bean is registered [1]
* The unregister bean in close call is no-op because the bean is not 
registered. But the channel will be closed, as part of close call.
* Now before finalizing session returns, some sort of exception is going to 
throw, because the channel is closed. Probably here [2].
* As part of exception the close is called again. This time it will 
unregister the bean (before this fix it will not, so it will miss this edge 
case.).

Basically we are safe as close will be called multiple times and guaranteed 
at least one close call will happen after cnx bean is registered. 

[1] 
https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java#L699
[2]

https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java#L716


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-2743) Netty connection leaks JMX connection bean upon connection close in certain race conditions.

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2743:
---

Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/211#discussion_r110081828
  
--- Diff: src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java ---
@@ -87,6 +87,12 @@ public void close() {
 LOG.debug("close called for sessionid:0x"
 + Long.toHexString(sessionId));
 }
+
+// ZOOKEEPER-2743:
+// Always unregister connection upon close to prevent
+// connection bean leak under certain race conditions.
+factory.unregisterConnection(this);
--- End diff --

That is fine, I might able to provide a formal verification of the theorem 
but here is a quick prove of that case:
* Assume close is called before connection bean is registered [1]
* The unregister bean in close call is no-op because the bean is not 
registered. But the channel will be closed, as part of close call.
* Now before finalizing session returns, some sort of exception is going to 
throw, because the channel is closed. Probably here [2].
* As part of exception the close is called again. This time it will 
unregister the bean (before this fix it will not, so it will miss this edge 
case.).

Basically we are safe as close will be called multiple times and guaranteed 
at least one close call will happen after cnx bean is registered. 

[1] 
https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java#L699
[2]

https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java#L716


> Netty connection leaks JMX connection bean upon connection close in certain 
> race conditions.
> 
>
> Key: ZOOKEEPER-2743
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2743
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: server
>Affects Versions: 3.4.10, 3.5.2
>Reporter: Michael Han
>Assignee: Michael Han
>  Labels: netty
>
> This is a tricky issue found while debugging failure of "flaky" watcher test 
> (ZOOKEEPER-2686). When closing a Netty connection, depend on timing the 
> connection bean registered when the connection was provisioned might not get 
> unregistered, leading to leaked Java beans. 
> The race happens at the time when the client is in the process of finalizing 
> the session. As part of session finalization, a connection bean will be 
> registered [1]. But right before the registering bean, the connection might 
> gets closed, in cases for example the server that the client is connecting to 
> is shutdown. As part of connection close, the bean will be un-registered, as 
> expected [2], however the problem is when we execute at [2], the connection 
> bean might not finish registering at [1], so the unregister of bean is a NOP. 
> What's worse, as part of connection close, we remove this connection from 
> connection factory [3], so future connection close call will get short 
> circuited and directly return; in other words the bean unregister code in 
> connection close call will only get executed once. Depends on luck, the bean 
> might not get unregistered, as previously illustrated.
> [1] 
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java#L700
> [2] 
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java#L114
> [3] 
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java#L96



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper pull request #211: ZOOKEEPER-2743: Netty connection leaks JMX conn...

2017-04-05 Thread hanm
Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/211#discussion_r110082136
  
--- Diff: src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java ---
@@ -87,6 +87,12 @@ public void close() {
 LOG.debug("close called for sessionid:0x"
 + Long.toHexString(sessionId));
 }
+
+// ZOOKEEPER-2743:
+// Always unregister connection upon close to prevent
+// connection bean leak under certain race conditions.
+factory.unregisterConnection(this);
--- End diff --

Also it is guaranteed that the close call will be called at least once 
after the cnx bean is registered (e.g. when sever shutdown, the factor will 
iterate every cnx and close it..).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-2743) Netty connection leaks JMX connection bean upon connection close in certain race conditions.

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2743:
---

Github user hanm commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/211#discussion_r110082136
  
--- Diff: src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java ---
@@ -87,6 +87,12 @@ public void close() {
 LOG.debug("close called for sessionid:0x"
 + Long.toHexString(sessionId));
 }
+
+// ZOOKEEPER-2743:
+// Always unregister connection upon close to prevent
+// connection bean leak under certain race conditions.
+factory.unregisterConnection(this);
--- End diff --

Also it is guaranteed that the close call will be called at least once 
after the cnx bean is registered (e.g. when sever shutdown, the factor will 
iterate every cnx and close it..).


> Netty connection leaks JMX connection bean upon connection close in certain 
> race conditions.
> 
>
> Key: ZOOKEEPER-2743
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2743
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: server
>Affects Versions: 3.4.10, 3.5.2
>Reporter: Michael Han
>Assignee: Michael Han
>  Labels: netty
>
> This is a tricky issue found while debugging failure of "flaky" watcher test 
> (ZOOKEEPER-2686). When closing a Netty connection, depend on timing the 
> connection bean registered when the connection was provisioned might not get 
> unregistered, leading to leaked Java beans. 
> The race happens at the time when the client is in the process of finalizing 
> the session. As part of session finalization, a connection bean will be 
> registered [1]. But right before the registering bean, the connection might 
> gets closed, in cases for example the server that the client is connecting to 
> is shutdown. As part of connection close, the bean will be un-registered, as 
> expected [2], however the problem is when we execute at [2], the connection 
> bean might not finish registering at [1], so the unregister of bean is a NOP. 
> What's worse, as part of connection close, we remove this connection from 
> connection factory [3], so future connection close call will get short 
> circuited and directly return; in other words the bean unregister code in 
> connection close call will only get executed once. Depends on luck, the bean 
> might not get unregistered, as previously illustrated.
> [1] 
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/ZooKeeperServer.java#L700
> [2] 
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java#L114
> [3] 
> https://github.com/apache/zookeeper/blob/master/src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java#L96



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] zookeeper issue #191: ZOOKEEPER-2722: fix flaky testSessionEstablishment tes...

2017-04-05 Thread rakeshadr
Github user rakeshadr commented on the issue:

https://github.com/apache/zookeeper/pull/191
  
+1 the patch looks good to me. Thanks @hanm 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ZOOKEEPER-2722) Flaky Test: org.apache.zookeeper.test.ReadOnlyModeTest.testSessionEstablishment

2017-04-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2722:
---

Github user rakeshadr commented on the issue:

https://github.com/apache/zookeeper/pull/191
  
+1 the patch looks good to me. Thanks @hanm 


> Flaky Test: 
> org.apache.zookeeper.test.ReadOnlyModeTest.testSessionEstablishment
> ---
>
> Key: ZOOKEEPER-2722
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2722
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: tests
>Reporter: Michael Han
>Assignee: Michael Han
>  Labels: flaky
> Fix For: 3.5.4, 3.6.0
>
>
> {noformat}
> Error Message
> KeeperErrorCode = ConnectionLoss for /test
> Stacktrace
> org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode 
> = ConnectionLoss for /test
>   at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
>   at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
>   at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:1423)
>   at 
> org.apache.zookeeper.test.ReadOnlyModeTest.testSessionEstablishment(ReadOnlyModeTest.java:238)
>   at 
> org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:79)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>   at java.lang.Thread.run(Thread.java:745)
> {noformat}
> Looks like we should retry before giving up.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (ZOOKEEPER-2722) Flaky Test: org.apache.zookeeper.test.ReadOnlyModeTest.testSessionEstablishment

2017-04-05 Thread Rakesh R (JIRA)

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

Rakesh R updated ZOOKEEPER-2722:

Fix Version/s: 3.4.11

> Flaky Test: 
> org.apache.zookeeper.test.ReadOnlyModeTest.testSessionEstablishment
> ---
>
> Key: ZOOKEEPER-2722
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2722
> Project: ZooKeeper
>  Issue Type: Bug
>  Components: tests
>Reporter: Michael Han
>Assignee: Michael Han
>  Labels: flaky
> Fix For: 3.5.4, 3.6.0, 3.4.11
>
>
> {noformat}
> Error Message
> KeeperErrorCode = ConnectionLoss for /test
> Stacktrace
> org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode 
> = ConnectionLoss for /test
>   at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
>   at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
>   at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:1423)
>   at 
> org.apache.zookeeper.test.ReadOnlyModeTest.testSessionEstablishment(ReadOnlyModeTest.java:238)
>   at 
> org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:79)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>   at java.lang.Thread.run(Thread.java:745)
> {noformat}
> Looks like we should retry before giving up.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)