ydb-python-sdk icon indicating copy to clipboard operation
ydb-python-sdk copied to clipboard

bug: reading in batch mode not work properly

Open a-tsarenko opened this issue 5 months ago • 0 comments

Bug Report

YDB Python SDK version:

ydb==3.17.2

Environment

Ubuntu 22.04, Python 3.11.7, x86_64

Current behavior:

When i read messages from topic in batch mode, i expect got 1+ messages, got only 1 every time

Expected behavior:

When i read messages from topic in batch mode, i got more than 1 message

Related code:

    async def _consume(self, reader: ydb.TopicReaderAsyncIO) -> None:
        while True:
            try:
                batch = await reader.receive_batch()
                if not batch:
                    await asyncio.sleep(1)
                    continue

            except TimeoutError as e:
                self.__logger.info('Error while receiving batch: %e ', e)
                continue

            for message in batch.messages:  #  <== got only 1 message here every time
                try:
                     ....  # processing

a-tsarenko avatar Sep 18 '24 14:09 a-tsarenko