-
Notifications
You must be signed in to change notification settings - Fork 936
Closed
Labels
code:CIssues that are specific to C behavior or domain within the library independent of library logicIssues that are specific to C behavior or domain within the library independent of library logicenhancementRequesting a feature changeRequesting a feature changemaintenanceAny tech debt or routine action tasks that should be tracked with an issueAny tech debt or routine action tasks that should be tracked with an issuepriority:highMaintainer triage tag for indicating high impact or criticality issuesMaintainer triage tag for indicating high impact or criticality issues
Description
Description
In my project I derived a new class from Producer to either implement a Mock producer for unit tests or a local Producer that just took snapshots of messages to a local cache.
The code looked like this
class MyProducer(Producer):
def __init__(self, config):
# Don't call super().__init__()
self._config = config
MyProducer().flush()
and then everything crashed.
Looking at the code, the Producer class internally is represented by Handle which has a rk property. This is set to NULL until __init__ is called, but a lot of the Handle code lacks NULL checks.
How to reproduce
See code example above.
Checklist
Please provide the following information:
- confluent-kafka-python and librdkafka version (
confluent_kafka.version()andconfluent_kafka.libversion()): master - Apache Kafka broker version:
- Client configuration:
{...} - Operating system:
- Provide client logs (with
'debug': '..'as necessary) - Provide broker log excerpts
- Critical issue
Metadata
Metadata
Assignees
Labels
code:CIssues that are specific to C behavior or domain within the library independent of library logicIssues that are specific to C behavior or domain within the library independent of library logicenhancementRequesting a feature changeRequesting a feature changemaintenanceAny tech debt or routine action tasks that should be tracked with an issueAny tech debt or routine action tasks that should be tracked with an issuepriority:highMaintainer triage tag for indicating high impact or criticality issuesMaintainer triage tag for indicating high impact or criticality issues