- 
                Notifications
    You must be signed in to change notification settings 
- Fork 934
Open
Labels
code:pythonIssues that are specific to Python or versions of Python independent of library logicIssues that are specific to Python or versions of Python independent of library logicdocsRequesting a documentation changeRequesting a documentation changepriority:highMaintainer triage tag for indicating high impact or criticality issuesMaintainer triage tag for indicating high impact or criticality issues
Description
I just followed the examples of how to produce/consume data with Python and got the message
ResourceWarning: unclosed <socket.socket fd=1152, family=2, type=1, proto=0, laddr=('...', 51820), raddr=('...', 8081)>
which is clearly the schema registry not closing everything. And it does not have a close method in contrast to the producer. Upon reading the source code, I found it contains a __exit__ method, meaning it is enabled to be used with a WITH clause. So the proper way should be
with SchemaRegistryClient(self.settings.schema_registry_config) as schema_registry_client:
and not what is being used in the examples.
| schema_registry_client = SchemaRegistryClient(schema_registry_conf) | 
Would be good to educate all by modifying the examples. Frankly, I would love to use producers/consumers/admin_client also with a WITH clause.
Metadata
Metadata
Assignees
Labels
code:pythonIssues that are specific to Python or versions of Python independent of library logicIssues that are specific to Python or versions of Python independent of library logicdocsRequesting a documentation changeRequesting a documentation changepriority:highMaintainer triage tag for indicating high impact or criticality issuesMaintainer triage tag for indicating high impact or criticality issues