diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_client_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_client_async.py index 6904d3cbe77e..72461ccbba58 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_client_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_client_async.py @@ -632,7 +632,7 @@ async def _receive_message_batch_impl_async(self, max_batch_size=None, on_messag try: await asyncio.wait_for( - self.do_work_async(batch=to_receive_size), + self.do_work_async(), timeout=timeout_time - now_time if timeout else None ) except asyncio.TimeoutError: diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/client.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/client.py index d4825747facf..aea6f886a02e 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/client.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/client.py @@ -706,7 +706,8 @@ def _receive_message_batch_impl(self, max_batch_size=None, on_message_received=N if timeout and time.time() > timeout: break - receiving = self.do_work(batch=to_receive_size) + #removed to_receive_size + receiving = self.do_work() cur_queue_size = self._received_messages.qsize() # after do_work, check how many new messages have been received since previous iteration received = cur_queue_size - before_queue_size