Skip to content

Commit

Permalink
Fix infinite loop in transport worker
Browse files Browse the repository at this point in the history
Summary:
Fix transport workers looping over and over instead of hibernating when
no work is available.

Reviewed By: RunyaoZhang

Differential Revision: D65697233

fbshipit-source-id: 7fb1453815ea98784457104e57830b72957ab1b0
  • Loading branch information
hsun324 authored and facebook-github-bot committed Nov 9, 2024
1 parent de1e10f commit 56589d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wa_raft_transport_worker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ handle_cast(Request, #state{number = Number} = State) ->
handle_info(timeout, #state{number = Number, jobs = Jobs, states = States} = State) ->
case queue:out(Jobs) of
{empty, NewJobs} ->
{noreply, State#state{jobs = NewJobs}, ?CONTINUE_TIMEOUT};
{noreply, State#state{jobs = NewJobs}, hibernate};
{{value, #transport{id = ID}}, NewJobs} ->
case wa_raft_transport:pop_file(ID) of
{ok, FileID} ->
Expand Down

0 comments on commit 56589d2

Please sign in to comment.