htran1 commented on a change in pull request #2942: GOBBLIN-1101(DSS-25241): 
Enhance bulk api retry for ExceedQuota
URL: https://github.com/apache/incubator-gobblin/pull/2942#discussion_r402679099
 
 

 ##########
 File path: 
gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/BulkResultIterator.java
 ##########
 @@ -117,14 +155,17 @@ private InputStreamCSVReader 
openAndSeekCsvReader(Exception exceptionRetryFor) {
       for (int j = 0; j < lineCount; j++) {
         lastSkippedLine = csvReader.nextRecord(); // skip these records
       }
-      if ((lastSkippedLine == null && preLoadedLine != null) || 
(lastSkippedLine != null && !lastSkippedLine.equals(preLoadedLine))) {
+      if ((lastSkippedLine == null && preLoadedLine != null) || 
(lastSkippedLine != null && !lastSkippedLine.equals(
+          preLoadedLine))) {
         // check if last skipped line is same as the line before error
-        throw new RuntimeException("Failed to verify last skipped line - 
retrying for =>", exceptionRetryFor);
+        String msg = rootCause == null? "null" : rootCause.getMessage();
+        throw new OpenAndSeekException("Failed to verify last skipped line - 
root cause [" + msg + "]", rootCause);
       }
       return csvReader;
-    } catch (Exception e) { // failed to open reader and skip lineCount lines
-      exceptionRetryFor = exceptionRetryFor != null? exceptionRetryFor : e;
-      throw new RuntimeException("Failed to [" + e.getMessage() + "] - 
retrying for => " , exceptionRetryFor);
+
+    } catch (Exception currentException) { // failed to open reader and skip 
lineCount lines // ssl failures go here
+      Throwable cause = rootCause == null? currentException : rootCause;
 
 Review comment:
   Add space between null and ?.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to