This is an automated email from the ASF dual-hosted git repository.

janhoy pushed a commit to branch branch_10_0
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_10_0 by this push:
     new da53a0bf1c8 SOLR-18027 Increase timeout for buildLocalAntoraSite 
(#3949)
da53a0bf1c8 is described below

commit da53a0bf1c8b27530750ea200f108ffdc7c90a52
Author: Jan Høydahl <[email protected]>
AuthorDate: Tue Dec 16 12:19:28 2025 +0100

    SOLR-18027 Increase timeout for buildLocalAntoraSite (#3949)
    
    (cherry picked from commit 8d3a800db1f6b4789d4a84ef96a1f78dfdb4aa65)
---
 solr/solr-ref-guide/build.gradle               | 22 +++++++++++--
 solr/solr-ref-guide/increase-undici-timeout.js | 45 ++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 2 deletions(-)

diff --git a/solr/solr-ref-guide/build.gradle b/solr/solr-ref-guide/build.gradle
index d94227812dd..c791c4978f3 100644
--- a/solr/solr-ref-guide/build.gradle
+++ b/solr/solr-ref-guide/build.gradle
@@ -405,7 +405,16 @@ task buildLocalAntoraSite(type: NpxTask) {
         "--fetch"
     ] + extraArgs
 
-    environment = ["SITE_SEARCH_ENABLED": "true", "MATOMO_ENABLED": "false"]
+    // Configure undici HTTP timeout via preload script to prevent timeout 
errors
+    // when downloading UI bundle from slow networks (especially in CI)
+    def nodeOptions = "--require ${projectDir}/increase-undici-timeout.js"
+
+    environment = [
+        "SITE_SEARCH_ENABLED": "true",
+        "MATOMO_ENABLED": "false",
+        "NODE_OPTIONS": nodeOptions,
+        "UNDICI_TIMEOUT_MS": "60000"  // 60 seconds timeout
+    ]
 
     inputs.files(fileTree(project.ext.siteStagingDir))
     inputs.property("Antora version", libs.versions.antora.asProvider().get())
@@ -500,7 +509,16 @@ task buildOfficialSite(type: NpxTask) {
         officialPlaybook,
     ] + extraArgs
 
-    environment = ["SITE_SEARCH_ENABLED": "true", "MATOMO_ENABLED": "true"]
+    // Configure undici HTTP timeout via preload script to prevent timeout 
errors
+    // when downloading UI bundle from slow networks (especially in CI)
+    def nodeOptions = "--require ${projectDir}/increase-undici-timeout.js"
+
+    environment = [
+        "SITE_SEARCH_ENABLED": "true",
+        "MATOMO_ENABLED": "true",
+        "NODE_OPTIONS": nodeOptions,
+        "UNDICI_TIMEOUT_MS": "60000"  // 60 seconds timeout
+    ]
 
     inputs.files(officialPlaybook)
     inputs.property("Antora version", libs.versions.antora.asProvider().get())
diff --git a/solr/solr-ref-guide/increase-undici-timeout.js 
b/solr/solr-ref-guide/increase-undici-timeout.js
new file mode 100644
index 00000000000..3940fe951d7
--- /dev/null
+++ b/solr/solr-ref-guide/increase-undici-timeout.js
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+/**
+ * Preload script to increase undici HTTP timeout for Antora UI bundle 
downloads.
+ *
+ * This script sets the global HTTP agent with longer timeout values to prevent
+ * timeout errors when downloading the UI bundle from slow or high-latency 
networks,
+ * particularly in CI environments.
+ *
+ * Issue: Node.js 20+ includes undici with default timeouts that may be too 
short
+ * for downloading the Antora UI bundle (925KB) from Apache's nightlies server.
+ *
+ * Usage: This script is preloaded via NODE_OPTIONS in the 
buildLocalAntoraSite task.
+ */
+
+// Configuration via environment variable
+const timeoutMs = parseInt(process.env.UNDICI_TIMEOUT_MS || '60000', 10);
+
+// Configure HTTP agent timeouts
+try {
+  const http = require('node:http');
+  const https = require('node:https');
+
+  http.globalAgent.timeout = timeoutMs;
+  https.globalAgent.timeout = timeoutMs;
+
+  console.log(`[undici-timeout] Configured HTTP agent timeouts: 
${timeoutMs}ms`);
+} catch (error) {
+  console.warn('[undici-timeout] Could not configure HTTP agent timeouts:', 
error.message);
+}

Reply via email to