mridulm commented on code in PR #39611:
URL: https://github.com/apache/spark/pull/39611#discussion_r1071698645
##########
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/RetryingBlockTransferor.java:
##########
@@ -203,16 +215,19 @@ private synchronized boolean shouldRetry(Throwable e) {
boolean isIOException = e instanceof IOException
|| e.getCause() instanceof IOException;
boolean isSaslTimeout = enableSaslRetries && e instanceof
SaslTimeoutException;
- if (!isSaslTimeout && saslTimeoutSeen) {
- retryCount = 0;
- saslTimeoutSeen = false;
+ // If this is a non SASL request failure, reduce earlier SASL failures
from retryCount
+ // since some subsequent SASL attempt was successful
+ if (!isSaslTimeout && saslRetryCount > 0) {
+ retryCount -= saslRetryCount;
+ if (retryCount < 0) {
+ throw new RuntimeException(
+ "retryCount is negative: " + retryCount + "(sasl retry count: " +
saslRetryCount + ").");
+ }
Review Comment:
Use `Preconditions` instead - `Preconditions.checkState(retryCount >=
saslRetryCount)` before the subtraction.
##########
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/RetryingBlockTransferor.java:
##########
@@ -236,9 +251,11 @@ private void handleBlockTransferSuccess(String blockId,
ManagedBuffer data) {
if (this == currentListener && outstandingBlocksIds.contains(blockId))
{
outstandingBlocksIds.remove(blockId);
shouldForwardSuccess = true;
- if (saslTimeoutSeen) {
- retryCount = 0;
- saslTimeoutSeen = false;
+ // If there were SASL failures earlier, remove them from retryCount,
as there was
+ // a SASL success (and some other request post bootstrap was also
successful).
+ if (saslRetryCount > 0) {
+ retryCount -= saslRetryCount;
Review Comment:
nit: Add the `Precondition` check here as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]