Skip to content

Fix keys leak in EntryLocationIndex when ledgersToDelete is empty#3903

Merged
hangc0276 merged 1 commit intoapache:masterfrom
hangc0276:chenhang/fix_keys_leak_in_entrylocationIndex_when_ledgersToDelete_empty
Apr 10, 2023
Merged

Fix keys leak in EntryLocationIndex when ledgersToDelete is empty#3903
hangc0276 merged 1 commit intoapache:masterfrom
hangc0276:chenhang/fix_keys_leak_in_entrylocationIndex_when_ledgersToDelete_empty

Conversation

@hangc0276
Copy link
Contributor

Motivation

In EntryLocationIndex#removeOffsetFromDeletedLedgers, if there are no ledgers to delete, the key pair will leak.

Changes

Check the ledgers to deletion Set first, and if the set is not empty, then generate the keys.

@AnonHxy
Copy link
Contributor

AnonHxy commented Apr 4, 2023

LGTM

Copy link
Member

@horizonzy horizonzy left a comment

Choose a reason for hiding this comment

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

Nice catch

Copy link
Contributor

@dlg99 dlg99 left a comment

Choose a reason for hiding this comment

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

good catch

@hangc0276 hangc0276 merged commit ceba605 into apache:master Apr 10, 2023
zymap pushed a commit that referenced this pull request Jun 19, 2023
)

### Motivation
In EntryLocationIndex#removeOffsetFromDeletedLedgers, if there are no ledgers to delete, the key pair will leak.

### Changes
Check the ledgers to deletion Set first, and if the set is not empty, then generate the keys.

(cherry picked from commit ceba605)
hangc0276 added a commit to hangc0276/bookkeeper that referenced this pull request Jun 26, 2023
…ache#3903)

In EntryLocationIndex#removeOffsetFromDeletedLedgers, if there are no ledgers to delete, the key pair will leak.

Check the ledgers to deletion Set first, and if the set is not empty, then generate the keys.

(cherry picked from commit ceba605)
zymap pushed a commit that referenced this pull request Dec 6, 2023
)

### Motivation
In EntryLocationIndex#removeOffsetFromDeletedLedgers, if there are no ledgers to delete, the key pair will leak.

### Changes
Check the ledgers to deletion Set first, and if the set is not empty, then generate the keys.

(cherry picked from commit ceba605)
Ghatage pushed a commit to sijie/bookkeeper that referenced this pull request Jul 12, 2024
…ache#3903)

### Motivation
In EntryLocationIndex#removeOffsetFromDeletedLedgers, if there are no ledgers to delete, the key pair will leak.

### Changes
Check the ledgers to deletion Set first, and if the set is not empty, then generate the keys.
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.

5 participants

Comments