donbowman commented on issue #11520:
URL: https://github.com/apache/druid/issues/11520#issuecomment-941026897


   presumably the issue is item.object is null, given it checks item and 
item.type for null.
   given that it can return with just a logged error, the original author must 
believe its not critical to success here.
   
   Now, this is iterating over a set of watched pods, its not clear how it 
expects the result or result type to be null either.
   
   ```
           public boolean hasNext() throws SocketTimeoutException
           {
             try {
               while (watch.hasNext()) {
                 Watch.Response<V1Pod> item = watch.next();
                 if (item != null && item.type != null) {
                   obj = new 
Watch.Response<DiscoveryDruidNodeAndResourceVersion>(
                       item.type,
                       new DiscoveryDruidNodeAndResourceVersion(
                           item.object.getMetadata().getResourceVersion(),
                           getDiscoveryDruidNodeFromPodDef(nodeRole, 
item.object)
                       )
                   );
                   return true;
                 } else {
                   LOGGER.error("WTH! item or item.type is NULL");
                 }
               }
             }
             catch (RuntimeException ex) {
               if (ex.getCause() instanceof SocketTimeoutException) {
                 throw (SocketTimeoutException) ex.getCause();
               } else {
                 throw ex;
               }
             }
   
             return false;
           }
   ```


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