You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2026/10/20 13:20:56 UTC

(pulsar) 18/19: [improve][doc] Warn about /tmp cleanup in narExtractionDirectory docs (#27011)

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

lhotari pushed a commit to branch branch-4.2-cherry-picks-2026-10-20
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit 5507b10944041ae8e6e27c4c4fb99aec061cd65f
Author: Lari Hotari <lh...@users.noreply.github.com>
AuthorDate: Tue Oct 20 13:52:35 2026 +0300

    [improve][doc] Warn about /tmp cleanup in narExtractionDirectory docs (#27011)
    
    (cherry picked from commit 091119d74ee5f812924d880917f49a1731629b4b)
---
 conf/broker.conf                                                  | 3 +++
 conf/functions_worker.yml                                         | 5 +++++
 conf/proxy.conf                                                   | 8 ++++++++
 conf/standalone.conf                                              | 3 +++
 .../main/java/org/apache/pulsar/broker/ServiceConfiguration.java  | 5 ++++-
 .../java/org/apache/pulsar/functions/worker/WorkerConfig.java     | 5 ++++-
 .../java/org/apache/pulsar/proxy/server/ProxyConfiguration.java   | 5 ++++-
 7 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/conf/broker.conf b/conf/broker.conf
index d82b1efdddb0..f7fd9296ae35 100644
--- a/conf/broker.conf
+++ b/conf/broker.conf
@@ -1987,6 +1987,9 @@ managedLedgerOffloadReadThreads=2
 # The extraction directory of the nar package.
 # Available for Protocol Handler, Additional Servlets, Entry Filter, Offloaders, Broker Interceptor.
 # Default is System.getProperty("java.io.tmpdir").
+# Outside of Kubernetes, OS cleanup of /tmp (for example, by systemd-tmpfiles) can delete extracted files while
+# the broker is running, which causes ClassNotFoundException or NoClassDefFoundError errors. In that case, set this
+# to a dedicated directory that isn't cleaned up automatically.
 narExtractionDirectory=
 
 # Maximum prefetch rounds for ledger reading for offloading
diff --git a/conf/functions_worker.yml b/conf/functions_worker.yml
index 794cfba1d519..9c563c57c7bf 100644
--- a/conf/functions_worker.yml
+++ b/conf/functions_worker.yml
@@ -430,6 +430,11 @@ functionsDirectory: ./functions
 enableReferencingFunctionsDirectoryFiles: true
 # Regex patterns for enabling creation of functions by referencing packages in matching http/https urls
 additionalEnabledFunctionsUrlPatterns: []
+# The extraction directory of the nar package. Default is System.getProperty("java.io.tmpdir").
+# Outside of Kubernetes, OS cleanup of /tmp (for example, by systemd-tmpfiles) can delete extracted files while
+# the functions worker is running, which causes ClassNotFoundException or NoClassDefFoundError errors. In that case,
+# set this to a dedicated directory that isn't cleaned up automatically.
+# narExtractionDirectory: /path/to/extracted-nars
 
 # Enables extended validation for connector config with fine-grain annotation based validation
 # during submission. Classloading with either enableClassloadingOfExternalFiles or
diff --git a/conf/proxy.conf b/conf/proxy.conf
index 48eab77362ff..14599f9c8e91 100644
--- a/conf/proxy.conf
+++ b/conf/proxy.conf
@@ -405,6 +405,14 @@ clusterName=
 # The directory to locate extensions
 #proxyExtensionsDirectory=
 
+# The extraction directory of the nar package.
+# Available for Proxy Extensions and Additional Servlets.
+# Default is System.getProperty("java.io.tmpdir").
+# Outside of Kubernetes, OS cleanup of /tmp (for example, by systemd-tmpfiles) can delete extracted files while
+# the proxy is running, which causes ClassNotFoundException or NoClassDefFoundError errors. In that case, set this
+# to a dedicated directory that isn't cleaned up automatically.
+narExtractionDirectory=
+
 ### --- Deprecated config variables --- ###
 
 # Deprecated. Use configurationStoreServers
diff --git a/conf/standalone.conf b/conf/standalone.conf
index 91c5715a4e2e..971ab2e15d90 100644
--- a/conf/standalone.conf
+++ b/conf/standalone.conf
@@ -1241,6 +1241,9 @@ schemaCompatibilityStrategy=FULL
 # The extraction directory of the nar package.
 # Available for Protocol Handler, Additional Servlets, Entry Filter, Offloaders, Broker Interceptor.
 # Default is System.getProperty("java.io.tmpdir").
+# Outside of Kubernetes, OS cleanup of /tmp (for example, by systemd-tmpfiles) can delete extracted files while
+# the broker is running, which causes ClassNotFoundException or NoClassDefFoundError errors. In that case, set this
+# to a dedicated directory that isn't cleaned up automatically.
 narExtractionDirectory=
 
 ### --- Deprecated config variables --- ###
diff --git a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
index 7cb1805f0efb..df91b2019119 100644
--- a/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
+++ b/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
@@ -3737,7 +3737,10 @@ public class ServiceConfiguration implements PulsarConfiguration {
 
     @FieldContext(
         category = CATEGORY_STORAGE_OFFLOADING,
-        doc = "The directory where nar Extraction of offloaders happens"
+        doc = "The directory where nar packages are extracted. Default is java.io.tmpdir. Outside of Kubernetes,"
+            + " OS cleanup of /tmp (for example, by systemd-tmpfiles) can delete extracted files while the broker is"
+            + " running, which causes ClassNotFoundException or NoClassDefFoundError errors. In that case, set this"
+            + " to a dedicated directory that isn't cleaned up automatically."
     )
     private String narExtractionDirectory = NarClassLoader.DEFAULT_NAR_EXTRACTION_DIR;
 
diff --git a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/worker/WorkerConfig.java b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/worker/WorkerConfig.java
index 036311ea1323..c0fb1247c1f0 100644
--- a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/worker/WorkerConfig.java
+++ b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/worker/WorkerConfig.java
@@ -277,7 +277,10 @@ public class WorkerConfig implements Serializable, PulsarConfiguration {
     private String connectorsDirectory = "./connectors";
     @FieldContext(
         category = CATEGORY_CONNECTORS,
-        doc = "The directory where nar packages are extractors"
+        doc = "The directory where nar packages are extracted. Default is java.io.tmpdir. Outside of Kubernetes,"
+            + " OS cleanup of /tmp (for example, by systemd-tmpfiles) can delete extracted files while the functions"
+            + " worker is running, which causes ClassNotFoundException or NoClassDefFoundError errors. In that case,"
+            + " set this to a dedicated directory that isn't cleaned up automatically."
     )
     private String narExtractionDirectory = NarClassLoader.DEFAULT_NAR_EXTRACTION_DIR;
     @FieldContext(
diff --git a/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java b/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java
index 55eee9e01e84..caeabb387fe0 100644
--- a/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java
+++ b/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConfiguration.java
@@ -351,7 +351,10 @@ public class ProxyConfiguration implements PulsarConfiguration {
 
     @FieldContext(
             category = CATEGORY_SERVER,
-            doc = "The directory where nar Extraction happens"
+            doc = "The directory where nar packages are extracted. Default is java.io.tmpdir. Outside of Kubernetes,"
+                + " OS cleanup of /tmp (for example, by systemd-tmpfiles) can delete extracted files while the proxy is"
+                + " running, which causes ClassNotFoundException or NoClassDefFoundError errors. In that case, set"
+                + " this to a dedicated directory that isn't cleaned up automatically."
     )
     private String narExtractionDirectory = NarClassLoader.DEFAULT_NAR_EXTRACTION_DIR;