Skip to content

Commit e5ac2c0

Browse files
authored
remove inaccurate keep alive logging (#34793)
1 parent 510318f commit e5ac2c0

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/_connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,13 @@ def _get_next_outgoing_channel(self) -> int:
337337

338338
def _outgoing_empty(self) -> None:
339339
"""Send an empty frame to prevent the connection from reaching an idle timeout."""
340-
if self._network_trace:
341-
_LOGGER.debug("-> EmptyFrame()", extra=self._network_trace_params)
342340
if self._error:
343341
raise self._error
344342

345343
try:
346344
if self._can_write():
345+
if self._network_trace:
346+
_LOGGER.debug("-> EmptyFrame()", extra=self._network_trace_params)
347347
self._transport.write(EMPTY_FRAME)
348348
self._last_frame_sent_time = time.time()
349349
except (OSError, IOError, SSLError, socket.error) as exc:

sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_client_async.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,6 @@ async def _keep_alive_async(self):
150150
current_time = time.time()
151151
elapsed_time = current_time - start_time
152152
if elapsed_time >= self._keep_alive_interval:
153-
_logger.debug(
154-
"Keeping %r connection alive.",
155-
self.__class__.__name__,
156-
extra=self._network_trace_params
157-
)
158153
await asyncio.shield(self._connection.listen(wait=self._socket_timeout,
159154
batch=self._link.current_link_credit))
160155
start_time = current_time

sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/aio/_connection_async.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,13 @@ def _get_next_outgoing_channel(self) -> int:
345345

346346
async def _outgoing_empty(self) -> None:
347347
"""Send an empty frame to prevent the connection from reaching an idle timeout."""
348-
if self._network_trace:
349-
_LOGGER.debug("-> EmptyFrame()", extra=self._network_trace_params)
350-
351348
if self._error:
352349
raise self._error
353350

354351
try:
355352
if self._can_write():
353+
if self._network_trace:
354+
_LOGGER.debug("-> EmptyFrame()", extra=self._network_trace_params)
356355
await self._transport.write(EMPTY_FRAME)
357356
self._last_frame_sent_time = time.time()
358357
except (OSError, IOError, SSLError, socket.error) as exc:

sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ def _keep_alive(self):
236236
current_time = time.time()
237237
elapsed_time = current_time - start_time
238238
if elapsed_time >= self._keep_alive_interval:
239-
_logger.debug("Keeping %r connection alive.", self.__class__.__name__)
240239
self._connection.listen(wait=self._socket_timeout, batch=self._link.current_link_credit)
241240
start_time = current_time
242241
time.sleep(1)

0 commit comments

Comments
 (0)