dapr / components-contrib

Community driven, reusable components for distributed apps
Apache License 2.0
548 stars 480 forks source link

Kafka component, data race when running and initializing multiple kafka components concurrently #3557

Open famarting opened 1 month ago

famarting commented 1 month ago

Expected Behavior

Kafka component supports to run and initialize multiple instances concurrently

Actual Behavior

I was writing some tests using the kafka component and I'm having a data race when running tests in parallel.

The data race is due to this https://github.com/dapr/components-contrib/blob/main/common/component/kafka/kafka.go#L190

the kafka component is overwriting a global sarama client variable, the data race produces when one component is running and using the sarama log and concurrently another kafka component is initializing.

Steps to Reproduce the Problem

Release Note

RELEASE NOTE:

github-actions[bot] commented 3 weeks ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

github-actions[bot] commented 2 weeks ago

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved. Thank you for your contributions.