kfaraz commented on code in PR #14382:
URL: https://github.com/apache/druid/pull/14382#discussion_r1222684848


##########
server/src/main/java/org/apache/druid/metadata/SQLMetadataSupervisorManager.java:
##########
@@ -259,7 +259,8 @@ public Pair<String, SupervisorSpec> map(int index, 
ResultSet r, StatementContext
                           );
                         }
                         catch (IOException e) {
-                          throw new RuntimeException(e);
+                          log.error(e, "Exception mapping SupervisorSpec for 
spec_id: [%s]", r.getString("spec_id"));

Review Comment:
   Nit:
   ```suggestion
                             log.error(e, "Could not map json payload to a 
SupervisorSpec for spec_id [%s]", r.getString("spec_id"));
   ```



##########
server/src/main/java/org/apache/druid/metadata/SQLMetadataSupervisorManager.java:
##########
@@ -259,7 +259,8 @@ public Pair<String, SupervisorSpec> map(int index, 
ResultSet r, StatementContext
                           );
                         }
                         catch (IOException e) {
-                          throw new RuntimeException(e);
+                          log.error(e, "Exception mapping SupervisorSpec for 
spec_id: [%s]", r.getString("spec_id"));
+                          return Pair.of(null, null);

Review Comment:
   Why not just return a null Pair instead of a Pair of nulls?



##########
server/src/main/java/org/apache/druid/metadata/SQLMetadataSupervisorManager.java:
##########
@@ -259,7 +259,8 @@ public Pair<String, SupervisorSpec> map(int index, 
ResultSet r, StatementContext
                           );
                         }
                         catch (IOException e) {
-                          throw new RuntimeException(e);
+                          log.error(e, "Exception mapping SupervisorSpec for 
spec_id: [%s]", r.getString("spec_id"));

Review Comment:
   The exception stack trace would include only snippets of the json payload, 
so we should probably include the json payload in the log message itself.



-- 
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]

Reply via email to