Skip to content

Commit

Permalink
fix: a potential race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
zmstone committed Aug 29, 2024
1 parent 7959fa3 commit 02541fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/wolff_producer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,13 @@ send_sync(Pid, Batch0, Timeout) ->
Timeout ->
deref_caller(Caller),
erlang:demonitor(Mref, [flush]),
erlang:error(timeout)
receive
{Mref, Partition, BaseOffset} ->
{Partition, BaseOffset}
after
0 ->
erlang:error(timeout)
end
end.

init(St) ->
Expand Down

0 comments on commit 02541fb

Please sign in to comment.