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

[Ray Core] Issue#35880 Fix the Exception error message bug which convert byte array to String #35883

Merged

Conversation

fantow
Copy link
Contributor

@fantow fantow commented May 30, 2023

Hi, I just get a strange exception message when I call the Ray.task() with a non-basic class type.

ray_pr

It seems like a wrong convert from byte[] to String with Arrays.toString().

@@ -49,7 +48,7 @@ public static List<FunctionArg> wrap(Object[] args, Language language) {
throw new IllegalArgumentException(
String.format(
"Can't transfer %s data to %s",
Arrays.toString(value.metadata), language.getValueDescriptor().getName()));
new String(value.metadata), language.getValueDescriptor().getName()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can just pack it in string type as we use raw bytes instead of string in Python: https://github.com/ray-project/ray/blob/master/python/ray/_private/ray_constants.py#L299-L303

One possible solution is that we align these stuff in both Java and Python, for example,
if (meta == b'PYTHON') {
new String("PYTHON");
} ...

Copy link
Contributor

@jovany-wang jovany-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed with @fantow offline, the value.metadata is only generated in current Java process, without any potential risk in cross language.

@jovany-wang
Copy link
Contributor

CI failed.

@jovany-wang
Copy link
Contributor

Lintcheck failure is unrelated. Retrying other failed CI jobs.

@jovany-wang jovany-wang added the testing topics about testing label Jun 2, 2023
@jjyao jjyao merged commit 5a371a4 into ray-project:master Jun 23, 2023
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
…o String. (ray-project#35883)

Signed-off-by: fantow <1727611626@qq.com>
Signed-off-by: e428265 <arvind.chandramouli@lmco.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing topics about testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants