He-Pin commented on code in PR #3092:
URL: https://github.com/apache/pekko/pull/3092#discussion_r3442479687


##########
remote/src/main/scala/org/apache/pekko/remote/artery/Association.scala:
##########
@@ -424,8 +424,25 @@ private[remote] class Association(
             }(materializer.executionContext)
           case _: SystemMessage =>
             sendSystemMessage(outboundEnvelope)
-          case ActorSelectionMessage(_: PriorityMessage, _, _) | _: 
ControlMessage | _: ClearSystemMessageDelivery =>
-            // ActorSelectionMessage with PriorityMessage is used by cluster 
and remote failure detector heartbeating
+          case sel: ActorSelectionMessage =>
+            sel.msg match {
+              case _: PriorityMessage =>
+                // ActorSelectionMessage with PriorityMessage is used by 
cluster and remote failure detector heartbeating
+                if (!controlQueue.offer(outboundEnvelope))
+                  dropped(ControlQueueIndex, controlQueueSize, 
outboundEnvelope)
+              case _ =>
+                // Distribute ActorSelection messages across lanes based on 
the target
+                // path hash rather than the anchor's (typically root 
guardian, UID=0).
+                // Without this, all ActorSelection messages concentrate on a 
single
+                // outbound lane, creating a throughput bottleneck.
+                val queueIndex =
+                  if (outboundLanes == 1) OrdinaryQueueIndex
+                  else OrdinaryQueueIndex + (math.abs(sel.elements.hashCode()) 
% outboundLanes)

Review Comment:
    Should we limit the outbound lanes to a power of 2? then we can do a quic 
mode



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