Skip to content

Commit

Permalink
Drop the @started_callback_cmd queue, suspected deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
grodowski committed Dec 10, 2024
1 parent 5659aa0 commit 837f027
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions test/helpers/data_writer_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def initialize(db_config,
@stop_requested = false

@start_cmd = Queue.new
@started_callback_cmd = Queue.new
start_synchronized_datawriter_threads

@logger = logger
Expand All @@ -60,7 +59,6 @@ def start(&on_write)
raise "Cannot start DataWriter multiple times. Use a new instance instead " if @started

@number_of_writers.times { @start_cmd << on_write }
@started_callback_cmd.pop
@started = true
end

Expand Down Expand Up @@ -142,7 +140,6 @@ def start_synchronized_datawriter_threads
n = 0
until @stop_requested do
write_data(connection, &on_write)
@started_callback_cmd << n unless @started
n += 1
# Kind of makes the following race condition a bit better...
# https://github.com/Shopify/ghostferry/issues/280
Expand All @@ -151,7 +148,6 @@ def start_synchronized_datawriter_threads

@logger.info("stopped data writer thread #{i} with a total of #{n} data writes")
ensure
@started_callback_cmd << n unless @started # if #stop_and_join is called before first write
connection&.close
end
end
Expand Down

0 comments on commit 837f027

Please sign in to comment.