This is an automated email from the ASF dual-hosted git repository.
merlimat pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 2476b1b4ad4 [improve][fn] Log function package download completion and
process PID (#25568)
2476b1b4ad4 is described below
commit 2476b1b4ad461cca977cae12634bb4084571c05f
Author: Lari Hotari <[email protected]>
AuthorDate: Thu Apr 23 17:16:28 2026 +0300
[improve][fn] Log function package download completion and process PID
(#25568)
---
.../apache/pulsar/functions/runtime/process/ProcessRuntime.java | 6 ++++--
.../java/org/apache/pulsar/functions/worker/FunctionActioner.java | 8 ++++++++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git
a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/process/ProcessRuntime.java
b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/process/ProcessRuntime.java
index 112bd901990..9a0f920b8cb 100644
---
a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/process/ProcessRuntime.java
+++
b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/process/ProcessRuntime.java
@@ -384,6 +384,7 @@ class ProcessRuntime implements Runtime {
log.info().attr("args", String.join(" ", processBuilder.command()))
.log("ProcessBuilder starting the process");
process = processBuilder.start();
+ log.info().attr("pid", process.pid()).log("Process started");
} catch (Exception ex) {
log.error().exception(ex).log("Starting process failed");
deathException = ex;
@@ -391,11 +392,12 @@ class ProcessRuntime implements Runtime {
}
try {
int exitValue = process.exitValue();
- log.error().attr("exitValue", exitValue)
+ log.error().attr("pid", process.pid())
+ .attr("exitValue", exitValue)
.log("Instance Process quit unexpectedly");
tryExtractingDeathException();
} catch (IllegalThreadStateException ex) {
- log.info("Started process successfully");
+ log.info().attr("pid", process.pid()).log("Started process
successfully");
}
}
diff --git
a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java
b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java
index 26342d6dd90..7f644d1b402 100644
---
a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java
+++
b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionActioner.java
@@ -267,6 +267,7 @@ public class FunctionActioner {
.attr("source", downloadFromHttp ? pkgLocationPath :
pkgLocation)
.log("Function package file will be downloaded");
+ long downloadStartMs = System.currentTimeMillis();
if (downloadFromHttp) {
if (!packageUrlValidator.isValidPackageUrl(componentType,
pkgLocationPath)) {
throw new IllegalArgumentException("Package URL " +
pkgLocationPath + " is not valid");
@@ -282,6 +283,13 @@ public class FunctionActioner {
pkgLocationPath);
}
}
+ log.info().attr("tenant", details.getTenant())
+ .attr("namespace", details.getNamespace())
+ .attr("functionName", details.getName())
+ .attr("pkgFile", tempPkgFile)
+ .attr("sizeBytes", tempPkgFile.length())
+ .attr("durationMs", System.currentTimeMillis() -
downloadStartMs)
+ .log("Function package file downloaded");
try {
// create a hardlink, if there are two concurrent createLink
operations, one will fail.