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

lhotari 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 0bf560fc0ca [fix][fn] Fix graceful Pulsar Function shutdown so that 
consumers and producers are closed (#25157)
0bf560fc0ca is described below

commit 0bf560fc0cacf75a31723fe96ecd48f6c1e3383b
Author: Lari Hotari <[email protected]>
AuthorDate: Fri Jan 16 15:54:59 2026 +0200

    [fix][fn] Fix graceful Pulsar Function shutdown so that consumers and 
producers are closed (#25157)
---
 .../java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
 
b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
index d99bdc26b88..50cb1fb54e8 100644
--- 
a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
+++ 
b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
@@ -380,6 +380,8 @@ public class JavaInstanceRunnable implements AutoCloseable, 
Runnable {
             if (stats != null) {
                 stats.incrSysExceptions(deathException);
             }
+            // clear possible thread interrupted state so that closing can be 
handled gracefully
+            Thread.interrupted();
         } finally {
             log.info("Closing instance");
             close();

Reply via email to