Skip to content

[Backport] SegmentLoadDropHandler: Fix deadlock when segments have errors loading on startup.#5755

Merged
jihoonson merged 1 commit intoapache:0.12.1from
gianm:backport-5735-to-0.12.1
May 9, 2018
Merged

[Backport] SegmentLoadDropHandler: Fix deadlock when segments have errors loading on startup.#5755
jihoonson merged 1 commit intoapache:0.12.1from
gianm:backport-5735-to-0.12.1

Conversation

@gianm
Copy link
Copy Markdown
Contributor

@gianm gianm commented May 8, 2018

Backport of #5735 to 0.12.1.

…g on startup. (apache#5735)

The "lock" object was used to synchronize start/stop as well as synchronize removals
from segmentsToDelete (when a segment is done dropping). This could cause a deadlock
if a segment-load throws an exception during loadLocalCache. loadLocalCache is run
by start() while it holds the lock, but then it spawns loading threads, and those
threads will try to acquire the "segmentsToDelete" lock if they want to drop a corrupt
segments.

I don't see any reason for these two locks to be the same lock, so I split them.
@gianm gianm added the Backport label May 8, 2018
@gianm gianm added this to the 0.12.1 milestone May 8, 2018
@jihoonson jihoonson merged commit af06da4 into apache:0.12.1 May 9, 2018
@gianm gianm deleted the backport-5735-to-0.12.1 branch September 23, 2022 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants