This is an automated email from the ASF dual-hosted git repository.
janhoy pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new a00232aa1d3 SOLR-18027 Increase timeout for buildLocalAntoraSite
(#3949)
a00232aa1d3 is described below
commit a00232aa1d3027b7a3deb4c3bade92ed2be87a13
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 18e28836ee1..c61e74caee4 100644
--- a/solr/solr-ref-guide/build.gradle
+++ b/solr/solr-ref-guide/build.gradle
@@ -416,7 +416,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", project.ext.antoraVersion)
@@ -511,7 +520,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", project.ext.antoraVersion)
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);
+}