[jira] Updated: (ZOOKEEPER-893) ZooKeeper high cpu usage when invalid requests

2010-10-19 Thread Flavio Junqueira (JIRA)

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

Flavio Junqueira updated ZOOKEEPER-893:
---

Status: Open  (was: Patch Available)

Missing a test.

 ZooKeeper high cpu usage when invalid requests
 --

 Key: ZOOKEEPER-893
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-893
 Project: Zookeeper
  Issue Type: Bug
  Components: server
Affects Versions: 3.3.1
 Environment: Linux 2.6.16
 4x Intel(R) Xeon(R) CPU X3320  @ 2.50GHz
 java version 1.6.0_17
 Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
 Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)
Reporter: Thijs Terlouw
Assignee: Thijs Terlouw
Priority: Critical
 Fix For: 3.3.2, 3.4.0

 Attachments: ZOOKEEPER-893.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 When ZooKeeper receives certain illegally formed messages on the internal 
 communication port (:4181 by default), it's possible for ZooKeeper to enter 
 an infinite loop which causes 100% cpu usage. It's related to ZOOKEEPER-427, 
 but that patch does not resolve all issues.
 from: src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java 
 the two affected parts:
 ===
 int length = msgLength.getInt();  
   
 if(length = 0) { 
   
 throw new IOException(Invalid packet length: + length); 
   
 } 
 ===
 ===
 while (message.hasRemaining()) {  
   
 temp_numbytes = channel.read(message);
   
 if(temp_numbytes  0) {   
   
 throw new IOException(Channel eof before end);  
   
 } 
   
 numbytes += temp_numbytes;
   
 } 
 ===
 how to replicate this bug:
 perform an nmap portscan against your zookeeper server: nmap -sV -n 
 your.ip.here -p4181
 wait for a while untill you see some messages in the logfile and then you 
 will see 100% cpu usage. It does not recover from this situation. With my 
 patch, it does not occur anymore

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



[jira] Updated: (ZOOKEEPER-893) ZooKeeper high cpu usage when invalid requests

2010-10-19 Thread Flavio Junqueira (JIRA)

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

Flavio Junqueira updated ZOOKEEPER-893:
---

Attachment: ZOOKEEPER-893.patch

Adding a test and removing an if statement that became unnecessary with this 
patch from RecvWorker.run(). I'll be adding a patch for the 3.3 branch shortly.

 ZooKeeper high cpu usage when invalid requests
 --

 Key: ZOOKEEPER-893
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-893
 Project: Zookeeper
  Issue Type: Bug
  Components: server
Affects Versions: 3.3.1
 Environment: Linux 2.6.16
 4x Intel(R) Xeon(R) CPU X3320  @ 2.50GHz
 java version 1.6.0_17
 Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
 Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)
Reporter: Thijs Terlouw
Assignee: Thijs Terlouw
Priority: Critical
 Fix For: 3.3.2, 3.4.0

 Attachments: ZOOKEEPER-893.patch, ZOOKEEPER-893.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 When ZooKeeper receives certain illegally formed messages on the internal 
 communication port (:4181 by default), it's possible for ZooKeeper to enter 
 an infinite loop which causes 100% cpu usage. It's related to ZOOKEEPER-427, 
 but that patch does not resolve all issues.
 from: src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java 
 the two affected parts:
 ===
 int length = msgLength.getInt();  
   
 if(length = 0) { 
   
 throw new IOException(Invalid packet length: + length); 
   
 } 
 ===
 ===
 while (message.hasRemaining()) {  
   
 temp_numbytes = channel.read(message);
   
 if(temp_numbytes  0) {   
   
 throw new IOException(Channel eof before end);  
   
 } 
   
 numbytes += temp_numbytes;
   
 } 
 ===
 how to replicate this bug:
 perform an nmap portscan against your zookeeper server: nmap -sV -n 
 your.ip.here -p4181
 wait for a while untill you see some messages in the logfile and then you 
 will see 100% cpu usage. It does not recover from this situation. With my 
 patch, it does not occur anymore

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



[jira] Updated: (ZOOKEEPER-893) ZooKeeper high cpu usage when invalid requests

2010-10-19 Thread Flavio Junqueira (JIRA)

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

Flavio Junqueira updated ZOOKEEPER-893:
---

Attachment: ZOOKEEPER-893-3.3.patch

Thanks, Thijs. Adding 3.3 patch. 

 ZooKeeper high cpu usage when invalid requests
 --

 Key: ZOOKEEPER-893
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-893
 Project: Zookeeper
  Issue Type: Bug
  Components: server
Affects Versions: 3.3.1
 Environment: Linux 2.6.16
 4x Intel(R) Xeon(R) CPU X3320  @ 2.50GHz
 java version 1.6.0_17
 Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
 Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)
Reporter: Thijs Terlouw
Assignee: Thijs Terlouw
Priority: Critical
 Fix For: 3.3.2, 3.4.0

 Attachments: ZOOKEEPER-893-3.3.patch, ZOOKEEPER-893.patch, 
 ZOOKEEPER-893.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 When ZooKeeper receives certain illegally formed messages on the internal 
 communication port (:4181 by default), it's possible for ZooKeeper to enter 
 an infinite loop which causes 100% cpu usage. It's related to ZOOKEEPER-427, 
 but that patch does not resolve all issues.
 from: src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java 
 the two affected parts:
 ===
 int length = msgLength.getInt();  
   
 if(length = 0) { 
   
 throw new IOException(Invalid packet length: + length); 
   
 } 
 ===
 ===
 while (message.hasRemaining()) {  
   
 temp_numbytes = channel.read(message);
   
 if(temp_numbytes  0) {   
   
 throw new IOException(Channel eof before end);  
   
 } 
   
 numbytes += temp_numbytes;
   
 } 
 ===
 how to replicate this bug:
 perform an nmap portscan against your zookeeper server: nmap -sV -n 
 your.ip.here -p4181
 wait for a while untill you see some messages in the logfile and then you 
 will see 100% cpu usage. It does not recover from this situation. With my 
 patch, it does not occur anymore

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



[jira] Updated: (ZOOKEEPER-893) ZooKeeper high cpu usage when invalid requests

2010-10-19 Thread Flavio Junqueira (JIRA)

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

Flavio Junqueira updated ZOOKEEPER-893:
---

Status: Patch Available  (was: Open)

 ZooKeeper high cpu usage when invalid requests
 --

 Key: ZOOKEEPER-893
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-893
 Project: Zookeeper
  Issue Type: Bug
  Components: server
Affects Versions: 3.3.1
 Environment: Linux 2.6.16
 4x Intel(R) Xeon(R) CPU X3320  @ 2.50GHz
 java version 1.6.0_17
 Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
 Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)
Reporter: Thijs Terlouw
Assignee: Thijs Terlouw
Priority: Critical
 Fix For: 3.3.2, 3.4.0

 Attachments: ZOOKEEPER-893-3.3.patch, ZOOKEEPER-893.patch, 
 ZOOKEEPER-893.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 When ZooKeeper receives certain illegally formed messages on the internal 
 communication port (:4181 by default), it's possible for ZooKeeper to enter 
 an infinite loop which causes 100% cpu usage. It's related to ZOOKEEPER-427, 
 but that patch does not resolve all issues.
 from: src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java 
 the two affected parts:
 ===
 int length = msgLength.getInt();  
   
 if(length = 0) { 
   
 throw new IOException(Invalid packet length: + length); 
   
 } 
 ===
 ===
 while (message.hasRemaining()) {  
   
 temp_numbytes = channel.read(message);
   
 if(temp_numbytes  0) {   
   
 throw new IOException(Channel eof before end);  
   
 } 
   
 numbytes += temp_numbytes;
   
 } 
 ===
 how to replicate this bug:
 perform an nmap portscan against your zookeeper server: nmap -sV -n 
 your.ip.here -p4181
 wait for a while untill you see some messages in the logfile and then you 
 will see 100% cpu usage. It does not recover from this situation. With my 
 patch, it does not occur anymore

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



[jira] Updated: (ZOOKEEPER-893) ZooKeeper high cpu usage when invalid requests

2010-10-19 Thread Patrick Hunt (JIRA)

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

Patrick Hunt updated ZOOKEEPER-893:
---

  Resolution: Fixed
Hadoop Flags: [Reviewed]
  Status: Resolved  (was: Patch Available)

+1 Great work, thanks!

 ZooKeeper high cpu usage when invalid requests
 --

 Key: ZOOKEEPER-893
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-893
 Project: Zookeeper
  Issue Type: Bug
  Components: server
Affects Versions: 3.3.1
 Environment: Linux 2.6.16
 4x Intel(R) Xeon(R) CPU X3320  @ 2.50GHz
 java version 1.6.0_17
 Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
 Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)
Reporter: Thijs Terlouw
Assignee: Thijs Terlouw
Priority: Critical
 Fix For: 3.3.2, 3.4.0

 Attachments: ZOOKEEPER-893-3.3.patch, ZOOKEEPER-893.patch, 
 ZOOKEEPER-893.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 When ZooKeeper receives certain illegally formed messages on the internal 
 communication port (:4181 by default), it's possible for ZooKeeper to enter 
 an infinite loop which causes 100% cpu usage. It's related to ZOOKEEPER-427, 
 but that patch does not resolve all issues.
 from: src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java 
 the two affected parts:
 ===
 int length = msgLength.getInt();  
   
 if(length = 0) { 
   
 throw new IOException(Invalid packet length: + length); 
   
 } 
 ===
 ===
 while (message.hasRemaining()) {  
   
 temp_numbytes = channel.read(message);
   
 if(temp_numbytes  0) {   
   
 throw new IOException(Channel eof before end);  
   
 } 
   
 numbytes += temp_numbytes;
   
 } 
 ===
 how to replicate this bug:
 perform an nmap portscan against your zookeeper server: nmap -sV -n 
 your.ip.here -p4181
 wait for a while untill you see some messages in the logfile and then you 
 will see 100% cpu usage. It does not recover from this situation. With my 
 patch, it does not occur anymore

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



[jira] Updated: (ZOOKEEPER-893) ZooKeeper high cpu usage when invalid requests

2010-10-13 Thread Patrick Hunt (JIRA)

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

Patrick Hunt updated ZOOKEEPER-893:
---

Status: Patch Available  (was: Open)

 ZooKeeper high cpu usage when invalid requests
 --

 Key: ZOOKEEPER-893
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-893
 Project: Zookeeper
  Issue Type: Bug
  Components: server
Affects Versions: 3.3.1
 Environment: Linux 2.6.16
 4x Intel(R) Xeon(R) CPU X3320  @ 2.50GHz
 java version 1.6.0_17
 Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
 Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)
Reporter: Thijs Terlouw
Assignee: Thijs Terlouw
Priority: Critical
 Fix For: 3.3.2, 3.4.0

 Attachments: ZOOKEEPER-893.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 When ZooKeeper receives certain illegally formed messages on the internal 
 communication port (:4181 by default), it's possible for ZooKeeper to enter 
 an infinite loop which causes 100% cpu usage. It's related to ZOOKEEPER-427, 
 but that patch does not resolve all issues.
 from: src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java 
 the two affected parts:
 ===
 int length = msgLength.getInt();  
   
 if(length = 0) { 
   
 throw new IOException(Invalid packet length: + length); 
   
 } 
 ===
 ===
 while (message.hasRemaining()) {  
   
 temp_numbytes = channel.read(message);
   
 if(temp_numbytes  0) {   
   
 throw new IOException(Channel eof before end);  
   
 } 
   
 numbytes += temp_numbytes;
   
 } 
 ===
 how to replicate this bug:
 perform an nmap portscan against your zookeeper server: nmap -sV -n 
 your.ip.here -p4181
 wait for a while untill you see some messages in the logfile and then you 
 will see 100% cpu usage. It does not recover from this situation. With my 
 patch, it does not occur anymore

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



[jira] Updated: (ZOOKEEPER-893) ZooKeeper high cpu usage when invalid requests

2010-10-13 Thread Patrick Hunt (JIRA)

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

Patrick Hunt updated ZOOKEEPER-893:
---

Fix Version/s: 3.4.0
   3.3.2

 ZooKeeper high cpu usage when invalid requests
 --

 Key: ZOOKEEPER-893
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-893
 Project: Zookeeper
  Issue Type: Bug
  Components: server
Affects Versions: 3.3.1
 Environment: Linux 2.6.16
 4x Intel(R) Xeon(R) CPU X3320  @ 2.50GHz
 java version 1.6.0_17
 Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
 Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)
Reporter: Thijs Terlouw
Priority: Critical
 Fix For: 3.3.2, 3.4.0

 Attachments: ZOOKEEPER-893.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 When ZooKeeper receives certain illegally formed messages on the internal 
 communication port (:4181 by default), it's possible for ZooKeeper to enter 
 an infinite loop which causes 100% cpu usage. It's related to ZOOKEEPER-427, 
 but that patch does not resolve all issues.
 from: src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java 
 the two affected parts:
 ===
 int length = msgLength.getInt();  
   
 if(length = 0) { 
   
 throw new IOException(Invalid packet length: + length); 
   
 } 
 ===
 ===
 while (message.hasRemaining()) {  
   
 temp_numbytes = channel.read(message);
   
 if(temp_numbytes  0) {   
   
 throw new IOException(Channel eof before end);  
   
 } 
   
 numbytes += temp_numbytes;
   
 } 
 ===
 how to replicate this bug:
 perform an nmap portscan against your zookeeper server: nmap -sV -n 
 your.ip.here -p4181
 wait for a while untill you see some messages in the logfile and then you 
 will see 100% cpu usage. It does not recover from this situation. With my 
 patch, it does not occur anymore

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



[jira] Updated: (ZOOKEEPER-893) ZooKeeper high cpu usage when invalid requests

2010-10-11 Thread Thijs Terlouw (JIRA)

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

Thijs Terlouw updated ZOOKEEPER-893:


Attachment: ZOOKEEPER-893.patch

 ZooKeeper high cpu usage when invalid requests
 --

 Key: ZOOKEEPER-893
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-893
 Project: Zookeeper
  Issue Type: Bug
  Components: server
Affects Versions: 3.3.1
 Environment: Linux 2.6.16
 4x Intel(R) Xeon(R) CPU X3320  @ 2.50GHz
 java version 1.6.0_17
 Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
 Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)
Reporter: Thijs Terlouw
Priority: Critical
 Attachments: ZOOKEEPER-893.patch


 When ZooKeeper receives certain illegally formed messages on the internal 
 communication port (:4181 by default), it's possible for ZooKeeper to enter 
 an infinite loop which causes 100% cpu usage. It's related to ZOOKEEPER-427, 
 but that patch does not resolve all issues.
 from: src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java 
 the two affected parts:
 ===
 int length = msgLength.getInt();  
   
 if(length = 0) { 
   
 throw new IOException(Invalid packet length: + length); 
   
 } 
 ===
 ===
 while (message.hasRemaining()) {  
   
 temp_numbytes = channel.read(message);
   
 if(temp_numbytes  0) {   
   
 throw new IOException(Channel eof before end);  
   
 } 
   
 numbytes += temp_numbytes;
   
 } 
 ===
 how to replicate this bug:
 perform an nmap portscan against your zookeeper server: nmap -sV -n 
 your.ip.here -p4181
 wait for a while untill you see some messages in the logfile and then you 
 will see 100% cpu usage. It does not recover from this situation. With my 
 patch, it does not occur anymore

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



[jira] Updated: (ZOOKEEPER-893) ZooKeeper high cpu usage when invalid requests

2010-10-11 Thread Thijs Terlouw (JIRA)

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

Thijs Terlouw updated ZOOKEEPER-893:


Remaining Estimate: 1h
 Original Estimate: 1h

 ZooKeeper high cpu usage when invalid requests
 --

 Key: ZOOKEEPER-893
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-893
 Project: Zookeeper
  Issue Type: Bug
  Components: server
Affects Versions: 3.3.1
 Environment: Linux 2.6.16
 4x Intel(R) Xeon(R) CPU X3320  @ 2.50GHz
 java version 1.6.0_17
 Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
 Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)
Reporter: Thijs Terlouw
Priority: Critical
 Attachments: ZOOKEEPER-893.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 When ZooKeeper receives certain illegally formed messages on the internal 
 communication port (:4181 by default), it's possible for ZooKeeper to enter 
 an infinite loop which causes 100% cpu usage. It's related to ZOOKEEPER-427, 
 but that patch does not resolve all issues.
 from: src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java 
 the two affected parts:
 ===
 int length = msgLength.getInt();  
   
 if(length = 0) { 
   
 throw new IOException(Invalid packet length: + length); 
   
 } 
 ===
 ===
 while (message.hasRemaining()) {  
   
 temp_numbytes = channel.read(message);
   
 if(temp_numbytes  0) {   
   
 throw new IOException(Channel eof before end);  
   
 } 
   
 numbytes += temp_numbytes;
   
 } 
 ===
 how to replicate this bug:
 perform an nmap portscan against your zookeeper server: nmap -sV -n 
 your.ip.here -p4181
 wait for a while untill you see some messages in the logfile and then you 
 will see 100% cpu usage. It does not recover from this situation. With my 
 patch, it does not occur anymore

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



[jira] Updated: (ZOOKEEPER-893) ZooKeeper high cpu usage when invalid requests

2010-10-11 Thread Thijs Terlouw (JIRA)

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

Thijs Terlouw updated ZOOKEEPER-893:


Attachment: (was: ZOOKEEPER-893.patch)

 ZooKeeper high cpu usage when invalid requests
 --

 Key: ZOOKEEPER-893
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-893
 Project: Zookeeper
  Issue Type: Bug
  Components: server
Affects Versions: 3.3.1
 Environment: Linux 2.6.16
 4x Intel(R) Xeon(R) CPU X3320  @ 2.50GHz
 java version 1.6.0_17
 Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
 Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)
Reporter: Thijs Terlouw
Priority: Critical
 Attachments: ZOOKEEPER-893.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 When ZooKeeper receives certain illegally formed messages on the internal 
 communication port (:4181 by default), it's possible for ZooKeeper to enter 
 an infinite loop which causes 100% cpu usage. It's related to ZOOKEEPER-427, 
 but that patch does not resolve all issues.
 from: src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java 
 the two affected parts:
 ===
 int length = msgLength.getInt();  
   
 if(length = 0) { 
   
 throw new IOException(Invalid packet length: + length); 
   
 } 
 ===
 ===
 while (message.hasRemaining()) {  
   
 temp_numbytes = channel.read(message);
   
 if(temp_numbytes  0) {   
   
 throw new IOException(Channel eof before end);  
   
 } 
   
 numbytes += temp_numbytes;
   
 } 
 ===
 how to replicate this bug:
 perform an nmap portscan against your zookeeper server: nmap -sV -n 
 your.ip.here -p4181
 wait for a while untill you see some messages in the logfile and then you 
 will see 100% cpu usage. It does not recover from this situation. With my 
 patch, it does not occur anymore

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



[jira] Updated: (ZOOKEEPER-893) ZooKeeper high cpu usage when invalid requests

2010-10-11 Thread Thijs Terlouw (JIRA)

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

Thijs Terlouw updated ZOOKEEPER-893:


Attachment: ZOOKEEPER-893.patch

 ZooKeeper high cpu usage when invalid requests
 --

 Key: ZOOKEEPER-893
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-893
 Project: Zookeeper
  Issue Type: Bug
  Components: server
Affects Versions: 3.3.1
 Environment: Linux 2.6.16
 4x Intel(R) Xeon(R) CPU X3320  @ 2.50GHz
 java version 1.6.0_17
 Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
 Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)
Reporter: Thijs Terlouw
Priority: Critical
 Attachments: ZOOKEEPER-893.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 When ZooKeeper receives certain illegally formed messages on the internal 
 communication port (:4181 by default), it's possible for ZooKeeper to enter 
 an infinite loop which causes 100% cpu usage. It's related to ZOOKEEPER-427, 
 but that patch does not resolve all issues.
 from: src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java 
 the two affected parts:
 ===
 int length = msgLength.getInt();  
   
 if(length = 0) { 
   
 throw new IOException(Invalid packet length: + length); 
   
 } 
 ===
 ===
 while (message.hasRemaining()) {  
   
 temp_numbytes = channel.read(message);
   
 if(temp_numbytes  0) {   
   
 throw new IOException(Channel eof before end);  
   
 } 
   
 numbytes += temp_numbytes;
   
 } 
 ===
 how to replicate this bug:
 perform an nmap portscan against your zookeeper server: nmap -sV -n 
 your.ip.here -p4181
 wait for a while untill you see some messages in the logfile and then you 
 will see 100% cpu usage. It does not recover from this situation. With my 
 patch, it does not occur anymore

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