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

Uncaught ConsumerStoppedError exceptions on closed streams #234

Closed
JeroennC opened this issue Nov 6, 2024 · 1 comment
Closed

Uncaught ConsumerStoppedError exceptions on closed streams #234

JeroennC opened this issue Nov 6, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@JeroennC
Copy link
Contributor

JeroennC commented Nov 6, 2024

Describe the bug
Streams running with the UDF approach are not silently shutting down when the consumers are stopped. The ConsumerStoppedError raised is never caught. In our application this is causing sentry errors while this is a graceful shutdown.

To Reproduce
Run a UDF consumer stream and shut down the application.

Expected behavior
I would expect stream.start() to suppress the ConsumerStoppedError.

Logs
Task exception was never retrieved
future: <Task finished name='Task-10' coro=<Stream.start() done, defined at /app/.venv/lib/python3.11/site-packages/kstreams/streams.py:334> exception=ConsumerStoppedError()>

ConsumerStoppedError: null
File "kstreams/streams.py", line 361, in start
await self.func_wrapper_with_typing()
File "kstreams/streams.py", line 367, in func_wrapper_with_typing
cr = await self.getone()
File "kstreams/streams.py", line 277, in getone
consumer_record: ConsumerRecord = await self.consumer.getone() # type: ignore
File "aiokafka/consumer/consumer.py", line 1160, in getone
msg = await self._fetcher.next_record(partitions)
File "aiokafka/consumer/fetcher.py", line 1086, in next_record
raise ConsumerStoppedError()

@marcosschroh marcosschroh self-assigned this Nov 6, 2024
@woile woile added the bug Something isn't working label Nov 7, 2024
marcosschroh added a commit that referenced this issue Nov 15, 2024
marcosschroh added a commit to marcosschroh/kstreams that referenced this issue Nov 15, 2024
marcosschroh added a commit to marcosschroh/kstreams that referenced this issue Nov 15, 2024
marcosschroh added a commit that referenced this issue Nov 15, 2024
marcosschroh added a commit that referenced this issue Nov 18, 2024
@marcosschroh
Copy link
Collaborator

closed by #238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants