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
[SPARK-38613][CORE] Change the exception type thrown by PushBlockStreamCallback#abortIfNecessary
from RuntimeException
to IllegalStateException
#35923
Conversation
cc @otterc, also ping @dongjoon-hyun @HyukjinKwon @srowen |
On the other hand, should we uniformly use
@srowen @dongjoon-hyun @HyukjinKwon If necessary, I will file a new Jira. |
I wouldn't change everything, but change cases where we suspect that it's catching too much. The problem here is really looking for RuntimeException, not the scope. That is too broad. Is something more specific thrown that we can catch without catching other stuff? |
The exception thrown from Lines 761 to 768 in acb50d9
Only |
We could fix that. This should really be something more specific - IllegalStateException? this is just the problem it causes, using RuntimeException |
ok |
testWritingPendingBufsIsAbortedImmediatelyDuringComplete
in RemoteBlockPushResolverSuite
PushBlockStreamCallback#abortIfNecessary
from RuntimeException
to IllegalStateException
@@ -756,12 +756,12 @@ private void writeDeferredBufs() throws IOException { | |||
} | |||
|
|||
/** | |||
* This throws RuntimeException if the number of IOExceptions have exceeded threshold. | |||
* This throws IllegalStateException if the number of IOExceptions have exceeded threshold. |
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.
No big deal but this can be * @throws IllegalStateException if ...
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.
4583b22 fix this
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.
Looks OK pending tests
Merged to master |
thanks @srowen |
What changes were proposed in this pull request?
This pr change the exception type thrown by
PushBlockStreamCallback#abortIfNecessary
fromRuntimeException
toIllegalStateException
and fixed the corresponding test case.In addition, this PR fixes the bug of
testWritingPendingBufsIsAbortedImmediatelyDuringComplete
inRemoteBlockPushResolverSuite
.RuntimeException
throw byspark/common/network-shuffle/src/test/java/org/apache/spark/network/shuffle/RemoteBlockPushResolverSuite.java
Lines 818 to 820 in acb50d9
before this pr, but the test case expects it to be thrown by
spark/common/network-shuffle/src/test/java/org/apache/spark/network/shuffle/RemoteBlockPushResolverSuite.java
Lines 834 to 840 in 2ca5d18
Why are the changes needed?
The
RuntimeException
is too broad, it should be specific.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Pass GA and fix related UTs