rd_kafka_abort_transaction() can sometimes fail with INVALID_TXN_STATE after a successful rd_kafka_transactions_init() and rd_kafka_begin_transaction().
$ docker run -it --rm -p 9092:9092 -e KAFKA_LOG4J_LOGGERS="kafka=DEBUG" apache/kafka:3.8.0
$ cc -o bug bug.c -lrdkafka
$ ./bug >log 2>&1
On my machine the program terminates after less than 10 seconds. If it doesn't, restarting it and rebuilding librdkafka in the background to generate noise helps.
Description
rd_kafka_abort_transaction() can sometimes fail with INVALID_TXN_STATE after a successful rd_kafka_transactions_init() and rd_kafka_begin_transaction().
How to reproduce
Reproducer:
On my machine the program terminates after less than 10 seconds. If it doesn't, restarting it and rebuilding librdkafka in the background to generate noise helps.
Checklist
9416dd80fb0dba71ff73a8cb4d2b919f54651006
3.8.0
log_level=7, debug=all, metadata.broker.list=localhost:9092, transactional.id=dummy, opaque=(void*)123, dr_msg_cb=kafka_conf_dr_msg_cb
Fedora 40 (x86_64)