Skip to content

Commit 0bf560f

Browse files
authored
[fix][fn] Fix graceful Pulsar Function shutdown so that consumers and producers are closed (#25157)
1 parent f5fc992 commit 0bf560f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ public void run() {
380380
if (stats != null) {
381381
stats.incrSysExceptions(deathException);
382382
}
383+
// clear possible thread interrupted state so that closing can be handled gracefully
384+
Thread.interrupted();
383385
} finally {
384386
log.info("Closing instance");
385387
close();

0 commit comments

Comments
 (0)