Fix segfault when tests runner terminates
A segfault in the confluent-kafka C module was raised when garbage collecting Kafka consumers.
Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
CallState_get (h=h@entry=0x7ffff004f2f0) at confluent_kafka/src/confluent_kafka.c:1921
1921 confluent_kafka/src/confluent_kafka.c: Aucun fichier ou dossier de ce type.
(gdb) bt
#0 CallState_get (h=h@entry=0x7ffff004f2f0) at confluent_kafka/src/confluent_kafka.c:1921
#1 0x00007ffff1223611 in Consumer_rebalance_cb (rk=0x1c13ca0, err=RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS, c_parts=0x7fffe4005bf0, opaque=0x7ffff004f2f0) at confluent_kafka/src/Consumer.c:1295
#2 0x00007ffff0c9abac in rd_kafka_poll_cb (rk=rk@entry=0x1c13ca0, rkq=rkq@entry=0x7fffc0005650, rko=rko@entry=0x7fffe4004f20, cb_type=cb_type@entry=RD_KAFKA_Q_CB_RETURN, opaque=opaque@entry=0x0) at rdkafka.c:3351
#3 0x00007ffff0c9b1e4 in rd_kafka_consumer_close (rk=rk@entry=0x1c13ca0) at rdkafka.c:2881
#4 0x00007ffff0c9b7dc in rd_kafka_destroy_app (rk=0x1c13ca0, flags=flags@entry=0) at rdkafka.c:967
#5 0x00007ffff0c9ba67 in rd_kafka_destroy (rk=<optimized out>) at rdkafka.c:1013
#6 0x00007ffff1224b0c in Consumer_dealloc (self=0x7ffff004f2f0) at confluent_kafka/src/Consumer.c:71
#7 0x00000000005bda40 in ?? ()
#8 0x00000000005bda40 in ?? ()
#9 0x00000000005ceb45 in ?? ()
#10 0x000000000052b8e8 in ?? ()
#11 0x000000000052b932 in ?? ()
#12 0x000000000059742b in ?? ()
#13 0x00000000005bdc98 in ?? ()
#14 0x000000000059769d in ?? ()
#15 0x00000000005b32bb in PyDict_Clear ()
#16 0x00000000005b33a9 in ?? ()
#17 0x00000000005265ce in ?? ()
#18 0x0000000000527761 in _PyObject_GC_New ()
Explicitely closing a consumer after its use in a test makes the segfault disappear.
Migrated from D2178 (view on Phabricator)