Skip to content

DefaultKafkaProducerFactory.stop() doesn't change running state #777

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

Closed
quaff opened this issue Aug 14, 2018 · 2 comments
Closed

DefaultKafkaProducerFactory.stop() doesn't change running state #777

quaff opened this issue Aug 14, 2018 · 2 comments
Milestone

Comments

@quaff
Copy link
Contributor

quaff commented Aug 14, 2018

https://github.com/spring-projects/spring-kafka/blob/master/spring-kafka/src/main/java/org/springframework/kafka/core/DefaultKafkaProducerFactory.java#L201

stop method should change running to false, it's better to use AtomicBoolean.compareAndSet() instead of volatile boolean

@artembilan
Copy link
Member

That’s good catch!
Feel free to provide a fix as a contribution.

Thank you!

quaff added a commit to quaff/spring-kafka that referenced this issue Aug 14, 2018
@quaff
Copy link
Contributor Author

quaff commented Aug 14, 2018

I have created PR#778

garyrussell added a commit that referenced this issue Aug 21, 2018
Fixes #777

So that `isRunning()` properly reflects the state.

In future, consider removing `Lifecycle` and close the producer(s)
with a `ContextStoppedEvent`.
garyrussell added a commit that referenced this issue Aug 21, 2018
Fixes #777

So that `isRunning()` properly reflects the state.

In future, consider removing `Lifecycle` and close the producer(s)
with a `ContextStoppedEvent`.
garyrussell added a commit that referenced this issue Aug 21, 2018
Fixes #777

So that `isRunning()` properly reflects the state.

In future, consider removing `Lifecycle` and close the producer(s)
with a `ContextStoppedEvent`.
@garyrussell garyrussell added this to the 2.1.9 milestone Aug 28, 2018
denis554 added a commit to denis554/spring-kafka that referenced this issue Mar 27, 2019
Fixes spring-projects/spring-kafka#777

So that `isRunning()` properly reflects the state.

In future, consider removing `Lifecycle` and close the producer(s)
with a `ContextStoppedEvent`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants