Skip to content

Commit

Permalink
Address pylint and clarify logging
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiitk committed Dec 14, 2023
1 parent f163b38 commit db21338
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def wait_for_xds_channel_active(
)

logger.info(
"[%s] ADS: Waiting for successful calls to xDS control plane to %s",
"[%s] ADS: Waiting for active calls to xDS control plane to %s",
self.hostname,
xds_server_uri,
)
Expand All @@ -292,7 +292,7 @@ def wait_for_xds_channel_active(
rpc_deadline=rpc_deadline,
)
logger.info(
"[%s] ADS: Detected successful calls to xDS control plane %s",
"[%s] ADS: Detected active calls to xDS control plane %s",
self.hostname,
xds_server_uri,
)
Expand Down Expand Up @@ -320,21 +320,27 @@ def find_active_xds_channel(
channel, **rpc_params
)
logger.info(
"[%s] Detected successful calls to xDS control plane %s,"
"[%s] Detected active calls to xDS control plane %s,"
" channel: %s",
self.hostname,
xds_server_uri,
_ChannelzServiceClient.channel_repr(channel),
_ChannelzServiceClient.channel_repr(channel_upd),
)
return channel_upd
except self.NotFound:
# Continue checking other channels to the same target on
# not found.
continue
except framework.rpc.grpc.RpcError as err:
logger.debug(
f"Unexpected error while checking"
f" channel {channel.ref.channel_id}: {err}"
# Logged at 'info' and not at 'warning' because this method is
# expected to be called in a retryer. If this error eventually
# causes the retryer to fail, it will be logged fully at 'error'
logger.info(
"[%s] Unexpected error while checking xDS control plane"
" channel %s: %r",
self.hostname,
_ChannelzServiceClient.channel_repr(channel),
err,
)
raise

Expand Down

0 comments on commit db21338

Please sign in to comment.