Skip to content

Commit 1293cab

Browse files
committed
Fix ConcurrentModificationException on commitLater
Invocations of consumer.commitAsync should be protected under the consumer semaphore, or you get errors like this when trying to call commitLater concurrently with poll: java.util.ConcurrentModificationException: KafkaConsumer is not safe for multi-threaded access
1 parent 8df890d commit 1293cab

File tree

1 file changed

+1
-1
lines changed
  • skafka/src/main/scala/com/evolutiongaming/skafka/consumer

1 file changed

+1
-1
lines changed

skafka/src/main/scala/com/evolutiongaming/skafka/consumer/Consumer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ object Consumer {
310310
}
311311
}
312312
}
313-
Sync[F].blocking(f(offsetCommitCallback)).as(Applicative[F].unit.some)
313+
serialNonBlocking(f(offsetCommitCallback)).as(Applicative[F].unit.some)
314314
}
315315
}
316316

0 commit comments

Comments
 (0)