From 2744918f9fa10885d01fe801f5d4c88da372ef94 Mon Sep 17 00:00:00 2001 From: pr0vieh Date: Wed, 21 Jan 2026 23:46:43 +0100 Subject: Add DNS/network errors (-1) to permanent error status codes - DNS errors (NXDOMAIN, SERVFAIL, UnknownHostException) now treated as permanent failures - Updated default permanentStatus from '404,410' to '404,410,-1' - Added documentation explaining -1 status code represents DNS/network failures - Updated UI description in IndexFederated_p.html to reflect DNS error handling - Affects both transferURL and transferRWI DHT operations --- defaults/yacy.init | 5 +++-- htroot/IndexFederated_p.html | 2 +- source/net/yacy/htroot/IndexFederated_p.java | 2 +- source/net/yacy/htroot/yacy/transferRWI.java | 2 +- source/net/yacy/htroot/yacy/transferURL.java | 2 +- source/net/yacy/search/SwitchboardConstants.java | 1 + 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/defaults/yacy.init b/defaults/yacy.init index 0d2fc0dc3..810f68614 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -587,8 +587,9 @@ indexReceiveBlockErrors=true indexReceiveBlockErrors.retryAfterDays=30 # Comma-separated list of HTTP status codes considered permanent errors (always block) -# Default: 404 (Not Found), 410 (Gone) -indexReceiveBlockErrors.permanentStatus=404,410 +# -1 = DNS/Network errors (UnknownHost, connection failures) +# 404 = Not Found, 410 = Gone +indexReceiveBlockErrors.permanentStatus=404,410,-1 # the frequency is the number of links per minute, that the peer allowes # _every_ other peer to send to this peer diff --git a/htroot/IndexFederated_p.html b/htroot/IndexFederated_p.html index 652899a48..c50c95137 100644 --- a/htroot/IndexFederated_p.html +++ b/htroot/IndexFederated_p.html @@ -125,7 +125,7 @@
for temporary errors; permanent errors stay blocked.
Permanent error statuses
-
comma-separated (default: 404,410)
+
comma-separated (default: 404,410,-1; -1=DNS/network errors)
diff --git a/source/net/yacy/htroot/IndexFederated_p.java b/source/net/yacy/htroot/IndexFederated_p.java index 9b7e8f74c..4acf5d996 100644 --- a/source/net/yacy/htroot/IndexFederated_p.java +++ b/source/net/yacy/htroot/IndexFederated_p.java @@ -72,7 +72,7 @@ public class IndexFederated_p { final int retryDays = post.getInt(SwitchboardConstants.INDEX_RECEIVE_BLOCK_ERRORS_RETRY_DAYS, 30); env.setConfig(SwitchboardConstants.INDEX_RECEIVE_BLOCK_ERRORS_RETRY_DAYS, retryDays); - final String permanent = post.get(SwitchboardConstants.INDEX_RECEIVE_BLOCK_ERRORS_PERMANENT, "404,410"); + final String permanent = post.get(SwitchboardConstants.INDEX_RECEIVE_BLOCK_ERRORS_PERMANENT, "404,410,-1"); env.setConfig(SwitchboardConstants.INDEX_RECEIVE_BLOCK_ERRORS_PERMANENT, permanent); } diff --git a/source/net/yacy/htroot/yacy/transferRWI.java b/source/net/yacy/htroot/yacy/transferRWI.java index d02875334..38c0bbbc4 100644 --- a/source/net/yacy/htroot/yacy/transferRWI.java +++ b/source/net/yacy/htroot/yacy/transferRWI.java @@ -246,7 +246,7 @@ public final class transferRWI { // Get configuration final int retryAfterDays = sb.getConfigInt(SwitchboardConstants.INDEX_RECEIVE_BLOCK_ERRORS_RETRY_DAYS, 30); - final String permanentStatusStr = sb.getConfig(SwitchboardConstants.INDEX_RECEIVE_BLOCK_ERRORS_PERMANENT, "404,410"); + final String permanentStatusStr = sb.getConfig(SwitchboardConstants.INDEX_RECEIVE_BLOCK_ERRORS_PERMANENT, "404,410,-1"); final Set permanentStatus = new HashSet(); for (String s : permanentStatusStr.split(",")) { try { permanentStatus.add(Integer.parseInt(s.trim())); } catch (NumberFormatException e) {} diff --git a/source/net/yacy/htroot/yacy/transferURL.java b/source/net/yacy/htroot/yacy/transferURL.java index 2ca3f533a..07af06601 100644 --- a/source/net/yacy/htroot/yacy/transferURL.java +++ b/source/net/yacy/htroot/yacy/transferURL.java @@ -154,7 +154,7 @@ public final class transferURL { doublecheck = 0; final boolean blockErrors = sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_BLOCK_ERRORS, true); final int retryAfterDays = sb.getConfigInt(SwitchboardConstants.INDEX_RECEIVE_BLOCK_ERRORS_RETRY_DAYS, 30); - final String permanentStatusStr = sb.getConfig(SwitchboardConstants.INDEX_RECEIVE_BLOCK_ERRORS_PERMANENT, "404,410"); + final String permanentStatusStr = sb.getConfig(SwitchboardConstants.INDEX_RECEIVE_BLOCK_ERRORS_PERMANENT, "404,410,-1"); final Set permanentStatus = new HashSet(); for (String s : permanentStatusStr.split(",")) { try { permanentStatus.add(Integer.parseInt(s.trim())); } catch (NumberFormatException e) {} diff --git a/source/net/yacy/search/SwitchboardConstants.java b/source/net/yacy/search/SwitchboardConstants.java index 3873e15eb..0e391e8ac 100644 --- a/source/net/yacy/search/SwitchboardConstants.java +++ b/source/net/yacy/search/SwitchboardConstants.java @@ -209,6 +209,7 @@ public final class SwitchboardConstants { public static final String INDEX_RECEIVE_BLOCK_BLACKLIST = "indexReceiveBlockBlacklist"; public static final String INDEX_RECEIVE_BLOCK_ERRORS = "indexReceiveBlockErrors"; public static final String INDEX_RECEIVE_BLOCK_ERRORS_RETRY_DAYS = "indexReceiveBlockErrors.retryAfterDays"; + /** Permanent error HTTP status codes (comma-separated). Default: 404,410,-1 (-1=DNS/network errors) */ public static final String INDEX_RECEIVE_BLOCK_ERRORS_PERMANENT = "indexReceiveBlockErrors.permanentStatus"; /** -- cgit v1.2.3