[
https://issues.apache.org/jira/browse/RATIS-2665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tsz-wo Sze resolved RATIS-2665.
-------------------------------
Fix Version/s: 3.4.0
Resolution: Fixed
The pull request is now merged. Thanks, [~backkom332]!
> SegmentedRaftLogWorker close may wait for the task queue poll timeout
> ---------------------------------------------------------------------
>
> Key: RATIS-2665
> URL: https://issues.apache.org/jira/browse/RATIS-2665
> Project: Ratis
> Issue Type: Improvement
> Components: RaftLog
> Affects Versions: 3.2.2
> Reporter: wangqiang
> Assignee: wangqiang
> Priority: Major
> Fix For: 3.4.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> SegmentedRaftLogWorker polls its I/O task queue with a one-second timeout.
> When close() is called while the worker is idle, the worker may still be
> blocked in DataBlockingQueue.poll(). It cannot observe the updated running
> state until the poll returns or times out. Therefore, closing an idle
> SegmentedRaftLogWorker may take up to one second.
> This delay is particularly noticeable when Raft groups are frequently created
> and removed, because each group shutdown may incur the same delay.
> Steps to reproduce:
> 1. Start a SegmentedRaftLog with no pending I/O tasks.
> 2. Wait until SegmentedRaftLogWorker is polling an empty task queue.
> 3. Close the SegmentedRaftLog.
> 4. Measure the close duration.
> The close operation typically takes approximately one second when the worker
> is idle.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)