We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42e2d01 commit f715bbeCopy full SHA for f715bbe
spring-kafka/src/main/java/org/springframework/kafka/core/DefaultKafkaProducerFactory.java
@@ -302,9 +302,13 @@ public void abortTransaction() throws ProducerFencedException {
302
}
303
304
@Override
305
- public synchronized void close() {
306
- if (this.cache != null && !this.cache.contains(this)) {
307
- this.cache.offer(this);
+ public void close() {
+ if (this.cache != null) {
+ synchronized (this) {
308
+ if (!this.cache.contains(this)) {
309
+ this.cache.offer(this);
310
+ }
311
312
313
314
0 commit comments