Skip to content

Commit 92b8f40

Browse files
committed
CQ: Use open_eventually in recovery
It's possible for Windows to be so stubborn that the file can't be opened after open_eventually has given up, which causes a crash and force the queue to be restarted, then trying to open that same file during recovery still errors out. Using open_eventually there may or may not help.
1 parent 080a2c7 commit 92b8f40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

deps/rabbit/src/rabbit_classic_queue_index_v2.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ recover_segments(State, _, StoreState, _, []) ->
262262
recover_segments(State0, ContainsCheckFun, StoreState0, CountersRef, [Segment|Tail]) ->
263263
SegmentEntryCount = segment_entry_count(),
264264
SegmentFile = segment_file(Segment, State0),
265-
{ok, Fd} = file:open(SegmentFile, [read, read_ahead, write, raw, binary]),
265+
{ok, Fd} = rabbit_file:open_eventually(SegmentFile,
266+
[read, read_ahead, write, raw, binary]),
266267
case file:read(Fd, ?HEADER_SIZE) of
267268
{ok, <<?MAGIC:32,?VERSION:8,
268269
_FromSeqId:64/unsigned,_ToSeqId:64/unsigned,

0 commit comments

Comments
 (0)