@EmbeddedKafka在关闭时转储了很多错误。有办法防止这种情况吗?很难发现实际错误。
发生在macos和linux ci容器上
配置(必须将副本设置为1才能使其正常工作):
@EmbeddedKafka(
count = 1,
partitions = 1,
brokerProperties = [
"listeners=PLAINTEXT://localhost:$TEST_BROKER_PORT",
"auto.create.topics.enable=true",
"offsets.topic.replication.factor=1",
"transaction.state.log.replication.factor=1",
"min.insync.replicas=1",
"transaction.state.log.min.isr=1"
],
topics = [
"topic"
]
)
错误:
2019-03-22 12:24:44.212 WARN 48845 --- [pool-8-thread-1] kafka.utils.CoreUtils$ : /var/folders/5w/gyj2xccs4bg24gd0yh2y05lm0000gn/T/kafka-2074874837210979630/__transaction_state-35/00000000000000000000.timeindex (No such file or directory) []
java.io.FileNotFoundException: /var/folders/5w/gyj2xccs4bg24gd0yh2y05lm0000gn/T/kafka-2074874837210979630/__transaction_state-35/00000000000000000000.timeindex (No such file or directory)
at java.io.RandomAccessFile.open0(Native Method)
at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
at kafka.log.AbstractIndex.$anonfun$resize$1(AbstractIndex.scala:179)
.....
scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at kafka.log.Log.maybeHandleIOException(Log.scala:1927)
at kafka.log.Log.close(Log.scala:709)
at kafka.log.LogManager.$anonfun$shutdown$8(LogManager.scala:456)
at kafka.utils.CoreUtils$$anon$1.run(CoreUtils.scala:63)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)