Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvme_gw_server: use dedicated rpc client for pings #19

Merged
merged 1 commit into from
May 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion nvme_gw_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class GWService(pb2_grpc.NVMEGatewayServicer):
persistent_config: Methods for target configuration persistence
spdk_rpc: Module methods for SPDK
spdk_rpc_client: Client of SPDK RPC server
spdk_rpc_ping_client: Ping client of SPDK RPC server
spdk_process: Subprocess running SPDK NVMEoF target application
"""

Expand Down Expand Up @@ -193,6 +194,13 @@ def start_spdk(self):
log_level=log_level,
conn_retries=conn_retries,
)
self.spdk_rpc_ping_client = self.spdk_rpc.client.JSONRPCClient(
spdk_rpc_socket,
None,
timeout,
log_level=log_level,
conn_retries=conn_retries,
)
except Exception as ex:
self.logger.error(f"Unable to initialize SPDK: \n {ex}")
raise
Expand Down Expand Up @@ -618,7 +626,7 @@ def nvmf_get_subsystems(self, request, context):
def ping(self):
"""Confirms communication with SPDK process."""
try:
ret = self.spdk_rpc.spdk_get_version(self.spdk_rpc_client)
ret = self.spdk_rpc.spdk_get_version(self.spdk_rpc_ping_client)
return True
except Exception as ex:
self.logger.error(f"spdk_get_version failed with: \n {ex}")
Expand Down