Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-344 - Fix for thread blocking issue contributed by Greg Kim

Sami Sirene427ad75ac62
diff --git a/CHANGES.txt b/CHANGES.txt
index db0431b98..63a5fecbd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,12 @@
Nutch Change Log
+Unreleased changes (0.9-dev)
+
+ 1. Changed log4j confiquration to log to stdout on commandline
+ tools (siren)
+
+ 2. NUTCH-344 - Fix for thread blocking issue (Greg Kim via siren)
+
Release 0.8 - 2006-07-25
0. Totally new architecture, based on hadoop
diff --git a/src/plugin/lib-http/src/java/org/apache/nutch/protocol/http/api/HttpBase.java b/src/plugin/lib-http/src/java/org/apache/nutch/protocol/http/api/HttpBase.java
index 7b0b1dc09..ea5a1ebe1 100644
--- a/src/plugin/lib-http/src/java/org/apache/nutch/protocol/http/api/HttpBase.java
+++ b/src/plugin/lib-http/src/java/org/apache/nutch/protocol/http/api/HttpBase.java
@@ -377,8 +377,8 @@ public abstract class HttpBase implements Protocol {
private static void cleanExpiredServerBlocks() {
synchronized (BLOCKED_ADDR_TO_TIME) {
- while (!BLOCKED_ADDR_QUEUE.isEmpty()) {
- String host = (String) BLOCKED_ADDR_QUEUE.getLast();
+ for(int i = BLOCKED_ADDR_QUEUE.size()-1; i >= 0; i--){
+ String host = (String) BLOCKED_ADDR_QUEUE.get(i);
long time = ((Long) BLOCKED_ADDR_TO_TIME.get(host)).longValue();
if (time <= System.currentTimeMillis()) {
BLOCKED_ADDR_TO_TIME.remove(host);