confluentinc / confluentinc/confluent-kafka-python

"Handle is terminating" exception when calling `delete_topics`

Open
#1,298 3 comments 0 reactions 0 assignees View on GitHub
bug enhancement status:waiting-for-interest
Dominant language
Python
Stars
509
Forks
964
Avg merge
2d 2h
Merged PRs (30d)
14

Description

It has been reported that:

```
AdminClient({...}).delete_topics(
topics=topics, operation_timeout=30.0
)
```

gives the exception:

```
cimpl.KafkaException: KafkaError{code=_DESTROY,val=-197,str="Handle is terminating: Success"}
```

whereas:

```
client: AdminClient = AdminClient({...})

client.delete_topics(
topics=topics, operation_timeout=30.0
)
```

does not.

stack trace:

```
File "/topics.py", line 26, in delete_topics
future.result()
File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 428, in result
return self.__get_result()
File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/home/airflow/.local/lib/python3.7/site-packages/confluent_kafka/admin/__init__.py", line 235, in _make_topics_result
result = f.result()
File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 428, in result
return self.__get_result()
File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
cimpl.KafkaException: KafkaError{code=_DESTROY,val=-197,str="Handle is terminating: Success"}
```

Seems like it might be a bug related to reference counting of the `AdminClient` instance.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.