Skip to content

[improve][fn] make built-in functions reload incremental - #25868

Merged
lhotari merged 3 commits into
apache:masterfrom
pratt4:improve-25791-functions-incremental-reload
Jun 2, 2026
Merged

[improve][fn] make built-in functions reload incremental#25868
lhotari merged 3 commits into
apache:masterfrom
pratt4:improve-25791-functions-incremental-reload

Conversation

@pratt4

@pratt4 pratt4 commented May 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #25791.

FunctionsManager.reloadFunctions() used to recreate every built-in function archive on reload, then close all previous FunctionArchive instances. That meant unchanged NARs were still reopened and their existing classloader/package state was discarded.

This mirrors the incremental reload behavior recently added for connectors.

Changes

  • Track function archive MD5 in FunctionArchive
  • Add FunctionUtils.reloadFunctions()
  • Reuse existing FunctionArchive instances when the archive path and MD5 are unchanged
  • Close only changed or removed function archives
  • Update FunctionsManager.reloadFunctions() to use the incremental reload result
  • Add regression tests for unchanged, changed, removed, and missing-directory reload cases

@pratt4

pratt4 commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

Hi @lhotari @Dream95
can you please review this pr whenever you get time ??

@pratt4 pratt4 changed the title Improve 25791 functions incremental reload [improve][fn] #25791 functions incremental reload May 25, 2026
@lhotari lhotari changed the title [improve][fn] #25791 functions incremental reload [improve][fn] make built-in functions reload incremental May 26, 2026
@lhotari

lhotari commented May 26, 2026

Copy link
Copy Markdown
Member

I renamed the title of this PR. It's better not to reference issues in the PR title, but instead describe in imperative form what the PR does (there's a similar best practice for commit messages).

@lhotari lhotari added this to the 5.0.0-M1 milestone Jun 2, 2026
@lhotari
lhotari merged commit d57af8f into apache:master Jun 2, 2026
44 of 46 checks passed
lhotari pushed a commit that referenced this pull request Jun 3, 2026
lhotari pushed a commit that referenced this pull request Jun 3, 2026
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 9, 2026
(cherry picked from commit d57af8f)
(cherry picked from commit fcf30df)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[improve][fn] Apply incremental reload to FunctionsManager (mirror connector reload)

3 participants