Skip to content

[HISTORY] History server disk store lease should remove temp path delete hook after commit and rollback to avoid memory leak#54947

Open
LennonChin wants to merge 1 commit intoapache:masterfrom
LennonChin:patch-1
Open

[HISTORY] History server disk store lease should remove temp path delete hook after commit and rollback to avoid memory leak#54947
LennonChin wants to merge 1 commit intoapache:masterfrom
LennonChin:patch-1

Conversation

@LennonChin
Copy link

What changes were proposed in this pull request?

In the History Server DiskManager, when acquiring a lease, a temporary directory is created on the disk, and a JVM shutdown hook is registered used to remove this temporary directory. When the lease is committed or rolled back, the temporary directory is either renamed to the target directory or deleted, but the registered JVM shutdown hook remains in the ShutdownHookManager, causing a memory leak. Additionally, a large number of residual hooks will execute when the History Server restarts, severely slowing down the restart process.

Why are the changes needed?

We should remove residual hooks when lease committed or rolled back.

Does this PR introduce any user-facing change?

How was this patch tested?

Was this patch authored or co-authored using generative AI tooling?

…fter commit and rollback to avoid memory leak
@LennonChin LennonChin changed the title History server disk store lease should remove temp path delete hook after commit and rollback to avoid memory leak [HISTORY] History server disk store lease should remove temp path delete hook after commit and rollback to avoid memory leak Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant