This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new e765187d3e7 [fix][fn] Fix graceful Pulsar Function shutdown so that
consumers and producers are closed (#25157)
e765187d3e7 is described below
commit e765187d3e741f963e44f9d1fe174b0436a778e8
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 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();