Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent producer start/stop #938

Open
valq7711 opened this issue Oct 31, 2023 · 0 comments
Open

Inconsistent producer start/stop #938

valq7711 opened this issue Oct 31, 2023 · 0 comments

Comments

@valq7711
Copy link

As there is self._closed = False in __init__, then it requires to call await producer.stop() even if it is not started.

producer = aiokafka.AIOKafkaProducer(bootstrap_servers="localhost:9092")
del producer  # Unclosed AIOKafkaProducer

self._closed = False
# Warn if producer was not closed properly
# We don't attempt to close the Consumer, as __del__ is synchronous
def __del__(self, _warnings=warnings):
if self._closed is False:
_warnings.warn(f"Unclosed AIOKafkaProducer {self!r}",
ResourceWarning,
source=self)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant