File tree Expand file tree Collapse file tree
pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/process Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -242,6 +242,15 @@ public CompletableFuture<FunctionStatus> getFunctionStatus(int instanceId) {
242242 retval .completeExceptionally (new RuntimeException ("Not alive" ));
243243 return retval ;
244244 }
245+ if (!isAlive ()) {
246+ FunctionStatus .Builder builder = FunctionStatus .newBuilder ();
247+ builder .setRunning (false );
248+ if (deathException != null && deathException .getMessage () != null ) {
249+ builder .setFailureException (deathException .getMessage ());
250+ }
251+ retval .complete (builder .build ());
252+ return retval ;
253+ }
245254 ListenableFuture <FunctionStatus > response = stub .withDeadlineAfter (GRPC_TIMEOUT_SECS , TimeUnit .SECONDS )
246255 .getFunctionStatus (Empty .newBuilder ().build ());
247256 Futures .addCallback (response , new FutureCallback <FunctionStatus >() {
You can’t perform that action at this time.
0 commit comments