Skip to content

Commit

Permalink
Avoid sharing the socket in forked process
Browse files Browse the repository at this point in the history
  • Loading branch information
Adithya Pentela committed Feb 16, 2020
1 parent 0dd1a0d commit 3e5331a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spec/rdkafka/producer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@
fork do
reader.close

# Avoids sharing the socket between processes.
producer = rdkafka_config.producer

handle = producer.produce(
topic: "produce_test_topic",
payload: "payload-forked",
Expand All @@ -307,7 +310,7 @@

writer.write(report_json)
writer.close
exit!
producer.close
end

writer.close
Expand Down

0 comments on commit 3e5331a

Please sign in to comment.