-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
ARROW-4236: [java] Distinct plasma client create exceptions #3306
ARROW-4236: [java] Distinct plasma client create exceptions #3306
Conversation
"The plasma store ran out of memory and could not create this object."); | ||
jclass Exception = env->FindClass( | ||
"org/apache/arrow/plasma/exceptions/PlasmaOutOfMemoryException"); | ||
env->ThrowNew(Exception, oid.hex().c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PlasmaOutOfMemoryException
doesn't take object id as the parameter.
|
||
public void put(byte[] objectId, byte[] value, byte[] metadata) | ||
throws DuplicateObjectException, PlasmaOutOfMemoryException { | ||
ByteBuffer buf = PlasmaClientJNI.create(threadConn.get(), objectId, value.length, metadata); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is threadConn
?
public class PlasmaOutOfMemoryException extends RuntimeException { | ||
|
||
public PlasmaOutOfMemoryException () { | ||
super("The plasma store ran out of memory and could not create object with ID."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove and could not create object with ID
super("The plasma store ran out of memory and could not create object with ID.", t); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line
super("An object with ID " + objectId + " already exists in the plasma store.", t); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line
"An object with this ID already exists in the plasma store."); | ||
jclass Exception = env->FindClass( | ||
"org/apache/arrow/plasma/exceptions/DuplicateObjectException"); | ||
env->ThrowNew(Exception, oid.hex().c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation looks off.. also exception? for name..
|
||
public void put(byte[] objectId, byte[] value, byte[] metadata) | ||
throws DuplicateObjectException, PlasmaOutOfMemoryException { | ||
ByteBuffer buf = PlasmaClientJNI.create(conn, objectId, value.length, metadata); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks backward incompatible..earlier we were ignoring any exceptions while creating the buffer
which is why the test is failing here -
pLink.put(id1, value1, null); |
any reason to change the behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is because it makes more sense to propagate the exception to user code, and let user decide what to do. E.g., when putting an object with existing ID, someone may want to silently ignore the error, someone may want to use a different ID, and someone may want to terminate the program. The decision should depends on application logic.
@praveenbingo could you help check the ci result. I can't see why it failed or does it have anything to do with my changes. I've tried several times, but they all failed. |
The CI failure should be unrelated. Because this PR only touches Java, but the failed tests are all Python. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also looks like the python tests are having core dumps..would you be able to run the python tests to see if they are caused by this change
(i am not an expert in plasma to comment authoritatively)
try { | ||
pLink.put(id1, value1, null); | ||
} catch (DuplicateObjectException e) { | ||
System.out.println("Plasma java client put same object twice exception test success."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you also want to assert that an exception is thrown..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I've added an assert. As for python tests, I've only changed java and jni files which won't have any influence on python code since python code won't reach these code in any cases. So I don't think ci failed because of my change
Can you please create a JIRA issue for this and update the PR title? |
@wesm I've asked somebody else to create the JIRA issue and paste the link above. Because I don't have authority. 'bibabolynn' is my account, maybe you can add me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me.
@bibabolynn @raulchen Are there any changes necessary in Ray for this? |
I added you as contributor and assigned the Issue to you. |
yes, there are changes in ray related to this which I will deal with after this pr is merged. That ray pr depends on this pr |
@wesm @pcmoritz @praveenbingo since this pr has already been approved, I wonder when will it be merged? |
@praveenbingo @wesm any other actions needed from our side? |
@pcmoritz is also a committer so he can also merge patches. Can you please rebase to make sure the build is passing? We fixed a bunch of problems that were going on in CI a couple weeks ago |
7c9eb0a
to
3e512b6
Compare
All tests are passing. @pcmoritz could you help merge it when you have time? Thanks! |
I re-run CI. Now, CI is green. |
Yes, merging it, thanks for the contribution! Originally I left it open in case there are more comments. |
when ray puts an object in plasma store, there are 2 exceptions may be thrown, one is "An object with this ID already exists in the plasma store" and the other is "The plasma store ran out of memory and could not create this object", distinct them rather than let them both be the same java class
@raulchen please help review