jason810496 commented on code in PR #64612:
URL: https://github.com/apache/airflow/pull/64612#discussion_r3098326137
##########
providers/apache/kafka/src/airflow/providers/apache/kafka/triggers/await_message.py:
##########
@@ -141,3 +145,12 @@ async def run(self):
if self.commit_offset:
await async_commit(message=message, asynchronous=False)
await asyncio.sleep(self.poll_interval)
+
+ async def cleanup(self) -> None:
+ consumer = self._consumer
+ if consumer is not None:
+ self._consumer = None
+ try:
+ await sync_to_async(consumer.close)()
+ except Exception:
+ log.warning("Failed to close Kafka consumer", exc_info=True)
Review Comment:
This isn't a real concern because the triggerer framework cancels run()
before calling cleanup(), so they don't execute concurrently.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]