smengcl commented on code in PR #5043:
URL: https://github.com/apache/ozone/pull/5043#discussion_r1260246260


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ContainerKeyMapperTask.java:
##########
@@ -263,6 +268,22 @@ public Pair<String, Boolean> process(OMUpdateEventBatch 
events) {
     return new ImmutablePair<>(getTaskName(), true);
   }
 
+  /**
+   * Checks if the object passed is an instance of `OmKeyInfo`.
+   *
+   * @param obj The object to check.
+   * @return True if the object is an instance of `OmKeyInfo`, false otherwise.
+   */
+  private boolean isOmKeyInfo(Object obj) {
+    if (obj instanceof OmKeyInfo) {
+      return true;
+    } else {
+      LOG.warn("Unexpected value type {} for key. Skipping processing.",
+          obj.getClass().getName());
+      return false;

Review Comment:
   While I get that a mitigation like this should work around the issue to 
avoid Recon crashes, this does not solve the problem from the source. i.e. 
where is that event even coming from
   
   In this case can we add more logging around where this `obj` was coming from 
initially to hopefully gather more info in hope of locating the culprit in the 
future? (e.g. adding identifying enum at the source side to help backtracking 
from the logs; add DEBUG logging in the code paths)



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