This is an automated email from the ASF dual-hosted git repository. lhotari pushed a commit to branch branch-4.0 in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 3726698ad89e2811332e78274c154ad16db7433c Author: Dream95 <[email protected]> AuthorDate: Tue May 19 19:43:54 2026 +0800 [improve][fn] Avoid gRPC timeout when getting status of a dead process runtime (#25819) Signed-off-by: Dream95 <[email protected]> (cherry picked from commit 5fd7518bd5522a0084d876c745a0ec870f1f2316) --- .../apache/pulsar/functions/runtime/process/ProcessRuntime.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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 e59fcadc729..24c41431c38 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 @@ -242,6 +242,15 @@ class ProcessRuntime implements Runtime { retval.completeExceptionally(new RuntimeException("Not alive")); return retval; } + if (!isAlive()) { + FunctionStatus.Builder builder = FunctionStatus.newBuilder(); + builder.setRunning(false); + if (deathException != null && deathException.getMessage() != null) { + builder.setFailureException(deathException.getMessage()); + } + retval.complete(builder.build()); + return retval; + } ListenableFuture<FunctionStatus> response = stub.withDeadlineAfter(GRPC_TIMEOUT_SECS, TimeUnit.SECONDS) .getFunctionStatus(Empty.newBuilder().build()); Futures.addCallback(response, new FutureCallback<FunctionStatus>() {
