This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new dfb172e6b64 [fix][fn] Fix graceful Pulsar Function shutdown so that
consumers and producers are closed (#25157)
dfb172e6b64 is described below
commit dfb172e6b64da6c8094d3e54a181c6c9bc6930f3
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)
(cherry picked from commit 0bf560fc0cacf75a31723fe96ecd48f6c1e3383b)
---
.../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 c9b069f8a6f..ccd28853639 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
@@ -349,6 +349,8 @@ public class JavaInstanceRunnable implements AutoCloseable,
Runnable {
if (stats != null) {
stats.incrSysExceptions(t);
}
+ // clear possible thread interrupted state so that closing can be
handled gracefully
+ Thread.interrupted();
} finally {
log.info("Closing instance");
close();