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

[Core]Fix internal_kv del api bug in ray client server proxy mode #37031

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions python/ray/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,17 @@ def test_get_runtime_context_gcs_client(call_ray_start_shared):
assert context.gcs_address, "gcs_address not set"


def test_internal_kv_in_proxy_mode(call_ray_start_shared):
import ray

ray.init(SHARED_CLIENT_SERVER_ADDRESS)
client_api = ray.util.client.ray
client_api._internal_kv_put(b"key", b"val")
assert client_api._internal_kv_get(b"key") == b"val"
assert client_api._internal_kv_del(b"key") == 1
assert client_api._internal_kv_get(b"key") is None


if __name__ == "__main__":
if os.environ.get("PARALLEL_CI"):
sys.exit(pytest.main(["-n", "auto", "--boxed", "-vs", __file__]))
Expand Down
2 changes: 1 addition & 1 deletion python/ray/util/client/server/proxier.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def KVDel(self, request, context=None) -> ray_client_pb2.KVDelResponse:
Otherwise, we proxy the call to the downstream server as usual.
"""
if self._has_channel_for_request(context):
return self._call_inner_function(request, context, "KVGet")
return self._call_inner_function(request, context, "KVDel")

with disable_client_hook():
ray.experimental.internal_kv._internal_kv_del(request.key)
Expand Down