Skip to content

Commit

Permalink
Ensure start_synchronized_datawriter_threads doesn't deadlock if stop…
Browse files Browse the repository at this point in the history
…ped before first write
  • Loading branch information
grodowski committed Dec 9, 2024
1 parent 8c817bf commit e76fd05
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/helpers/data_writer_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,14 @@ def start_synchronized_datawriter_threads
begin
until @stop_requested do
write_data(connection, &on_write)
@started_callback_cmd << n unless @started
@started_callback_cmd << n
n += 1
# Kind of makes the following race condition a bit better...
# https://github.com/Shopify/ghostferry/issues/280
sleep(0.03)
end
ensure
@started_callback_cmd << n
connection.close
end

Expand Down

0 comments on commit e76fd05

Please sign in to comment.