clintropolis commented on code in PR #14985:
URL: https://github.com/apache/druid/pull/14985#discussion_r1378769828


##########
server/src/main/java/org/apache/druid/client/SegmentLoadInfo.java:
##########
@@ -59,6 +61,15 @@ public ImmutableSegmentLoadInfo toImmutableSegmentLoadInfo()
     return new ImmutableSegmentLoadInfo(segment, servers);
   }
 
+  /**
+   * Randomly return one server from the sets of {@code servers}
+   */
+  public DruidServerMetadata pickOne()
+  {
+    synchronized (this) {

Review Comment:
   >can you please clarify this statement?
   
   I mean that since we just pick and return a server and release the lock, 
nothing technically prevents the segment from being removed from the server 
while the code that picked a server holds reference to it. I don't think that 
is very problematic, but if it was for some reason, we would need to do 
whatever we need to do with the server under the lock (load/drop would need to 
interact with the same locks if not already i think to truly prevent these 
sorts of issues)



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