Github user harishreedharan commented on the pull request:
https://github.com/apache/spark/pull/2994#issuecomment-61040608
I talked to people working on Kafka, and they assure me it is thread-safe.
Also see this:
https://github.com/apache/flume/blob/trunk/flume-ng-channels/flume-kafka-channel/src/main/java/org/apache/flume/channel/kafka/KafkaChannel.java
There is a single producer that is written to by various threads. See the
corresponding test where it is written from multiple threads. I have run it in
loops several times on travis, never seen a threading issue.
By creating a Producer per partition, this issue is avoided anyway. For
now, we can keep it simple by creating a producer per partition - if we see
this is a problem, we can revert to the ProducerCache.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]