Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sarama asyncproducer plugin - possibility of data transfer over a closed channel #108

Open
dwkang opened this issue Dec 24, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@dwkang
Copy link
Contributor

dwkang commented Dec 24, 2024

	go func() {
		for {
			select {
			case msgCtx, ok := <-wrapped.inputContext:
				if !ok {
					return
				}
				span := newAsyncProducerTracer(msgCtx.ctx, addrs, msgCtx.msg, config)
				producer.Input() <- msgCtx.msg
				saveAsyncProducerTracer(config, wrapped, span)

			case msg, ok := <-wrapped.input:
				if !ok {
					return
				}
				span := newAsyncProducerTracer(wrapped.ctx, addrs, msg, config)
				producer.Input() <- msg
				saveAsyncProducerTracer(config, wrapped, span)
			}
		}
	}()

If it close the async producer before the topic message is processed,
sending may occur to the input channel closed on the async producer.

@dwkang dwkang added the bug Something isn't working label Dec 24, 2024
@dwkang dwkang added this to the v1.4.6 milestone Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant