Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[fix][fn] Fix graceful Pulsar Function shutdown so that consumers and producers are closed#25157

Merged
lhotari merged 1 commit intoapache:masterfrom
lhotari:lh-fix-graceful-function-shutdown
Jan 16, 2026
Merged

[fix][fn] Fix graceful Pulsar Function shutdown so that consumers and producers are closed#25157
lhotari merged 1 commit intoapache:masterfrom
lhotari:lh-fix-graceful-function-shutdown

Conversation

Copy link
Member

lhotari commented Jan 16, 2026

Fixes #25154

Motivation

While investigating a flaky test, I noticed that a Pulsar Function instance didn't shutdown gracefully due to interrupted thread status. The change in #25140 brought this to surface since closing producers gracefully requires that the calling thread isn't interrupted.

Modifications

Clear the interrupted state of the current thread in the Function instance before proceeding to call the close method.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

lhotari added this to the 4.2.0 milestone Jan 16, 2026
lhotari requested review from BewareMyPower, Technoboy-, codelipenghui, dao-jun, merlimat and nodece January 16, 2026 12:50
lhotari self-assigned this Jan 16, 2026
github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jan 16, 2026
nodece approved these changes Jan 16, 2026
liangyepianzhou approved these changes Jan 16, 2026
Copy link
Contributor

liangyepianzhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

codecov-commenter commented Jan 16, 2026

Codecov Report

All modified and coverable lines are covered by tests.
Project coverage is 72.53%. Comparing base (413387b) to head (ab15c09).
Report is 1 commits behind head on master.

Additional details and impacted files

@@ Coverage Diff @@
## master #25157 +/- ##
=============================================
+ Coverage 37.48% 72.53% +35.05%
- Complexity 13220 34226 +21006
=============================================
Files 1899 1956 +57
Lines 150586 154750 +4164
Branches 17159 17645 +486
=============================================
+ Hits 56440 112241 +55801
+ Misses 86464 33539 -52925
- Partials 7682 8970 +1288
Flag Coverage D
inttests 25.74% <0.00%> (+0.09%)
systests 22.41% <100.00%> (-0.03%)
unittests 73.47% <100.00%> (+39.31%)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage D
...ulsar/functions/instance/JavaInstanceRunnable.java 73.17% <100.00%> (+12.14%)

... and 1417 files with indirect coverage changes

New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

lhotari merged commit 0bf560f into apache:master Jan 16, 2026
56 checks passed
lhotari added a commit that referenced this pull request Jan 16, 2026
... producers are closed (#25157)

(cherry picked from commit 0bf560f)
lhotari added the cherry-picked/branch-4.0 label Jan 16, 2026
lhotari added a commit that referenced this pull request Jan 16, 2026
... producers are closed (#25157)

(cherry picked from commit 0bf560f)
lhotari added the cherry-picked/branch-4.1 label Jan 16, 2026
lhotari added a commit that referenced this pull request Jan 16, 2026
... producers are closed (#25157)

(cherry picked from commit 0bf560f)
lhotari added the cherry-picked/branch-3.0 label Jan 16, 2026
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Jan 19, 2026
... producers are closed (apache#25157)

(cherry picked from commit 0bf560f)
(cherry picked from commit dfb172e)
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Jan 20, 2026
... producers are closed (apache#25157)

(cherry picked from commit 0bf560f)
(cherry picked from commit 4183569)
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Jan 20, 2026
... producers are closed (apache#25157)

(cherry picked from commit 0bf560f)
(cherry picked from commit dfb172e)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jan 20, 2026
... producers are closed (apache#25157)

(cherry picked from commit 0bf560f)
(cherry picked from commit 4183569)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jan 28, 2026
... producers are closed (apache#25157)

(cherry picked from commit 0bf560f)
(cherry picked from commit dfb172e)
Rutuja-IBM pushed a commit to datastax/pulsar that referenced this pull request Feb 9, 2026
... producers are closed (apache#25157)

(cherry picked from commit 0bf560f)
(cherry picked from commit dfb172e)
Rutuja-IBM pushed a commit to datastax/pulsar that referenced this pull request Feb 9, 2026
... producers are closed (apache#25157)

(cherry picked from commit 0bf560f)
(cherry picked from commit dfb172e)
Rutuja-IBM pushed a commit to datastax/pulsar that referenced this pull request Feb 12, 2026
... producers are closed (apache#25157)

(cherry picked from commit 0bf560f)
(cherry picked from commit dfb172e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

nodece nodece approved these changes

liangyepianzhou liangyepianzhou approved these changes

merlimat Awaiting requested review from merlimat

Technoboy- Awaiting requested review from Technoboy-

codelipenghui Awaiting requested review from codelipenghui

BewareMyPower Awaiting requested review from BewareMyPower

dao-jun Awaiting requested review from dao-jun

Assignees

lhotari

Projects

None yet

Milestone

4.2.0

Development

Successfully merging this pull request may close these issues.

Flaky-test: PulsarFunctionE2ESecurityTest.testAuthorization

4 participants