[ https://issues.apache.org/jira/browse/MAPREDUCE-7368?focusedWorklogId=690466&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-690466 ]
ASF GitHub Bot logged work on MAPREDUCE-7368: --------------------------------------------- Author: ASF GitHub Bot Created on: 04/Dec/21 08:06 Start Date: 04/Dec/21 08:06 Worklog Time Spent: 10m Work Description: ayushtkn commented on a change in pull request #3671: URL: https://github.com/apache/hadoop/pull/3671#discussion_r762400115 ########## File path: hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/db/DBOutputFormat.java ########## @@ -122,7 +122,7 @@ public void write(K key, V value) throws IOException { key.write(statement); statement.addBatch(); } catch (SQLException e) { - e.printStackTrace(); + throw new RuntimeException("Failed to execute SQL statement for key " + key, e); Review comment: In other places. It is converting the SQLException to IOE. `` catch (SQLException ex) { throw new IOException(ex.getMessage()); `` Can we keep the same behaviour, will that also solve the problem. -- 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: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 690466) Time Spent: 0.5h (was: 20m) > DBOutputFormat.DBRecordWriter#write must throw exception when it fails > ---------------------------------------------------------------------- > > Key: MAPREDUCE-7368 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-7368 > Project: Hadoop Map/Reduce > Issue Type: Bug > Affects Versions: 3.3.1 > Reporter: Stamatis Zampetakis > Priority: Major > Labels: pull-request-available > Time Spent: 0.5h > Remaining Estimate: 0h > > When the > [DBRecordWriter#write|https://github.com/apache/hadoop/blob/91af256a5b44925e5dfdf333293251a19685ba2a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/db/DBOutputFormat.java#L120] > fails with an {{SQLException}} the problem is not propagated but printed in > {{System.err}} instead. > {code:java} > public void write(K key, V value) throws IOException { > try { > key.write(statement); > statement.addBatch(); > } catch (SQLException e) { > e.printStackTrace(); > } > } > {code} > The consumer of this API has no way to tell that the write failed. Moreover, > the exception is not present in the logs which makes the problem very hard > debug and can easily lead to data corruption since clients can easily assume > that everything went well. -- This message was sent by Atlassian Jira (v8.20.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: mapreduce-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: mapreduce-issues-h...@hadoop.apache.org