pjfanning opened a new issue, #3672:
URL: https://github.com/apache/pekko/issues/3672

   ### Problem
   When two Artery systems share the same system uid, the system that detects 
the collision rejects the second peer's handshake but can still deliver that 
peer's messages to local actors. Replies to them are not delivered. This was 
reproduced while reviewing #3652. With three systems where two share a uid:
   - The receiver keeps the colliding peer's association at `UidUnknown`.
   - The colliding peer completes its own handshake with the receiver, because 
it received the receiver's `HandshakeReq`.
   - A message from the colliding peer reaches the receiver's actor. The reply 
never returns.
   - The healthy peer keeps working.
   
   ### Why the receiver cannot drop it
   - The Artery envelope header identifies the sender system only by its uid. 
The inbound decoder resolves that uid to the existing (healthy) association 
(`Codecs.scala`, `inboundContext.association(originUid)`), and 
`InboundHandshake.isKnownOrigin` then accepts the message.
   - Inbound connections are merged (TCP `MergeHub`, or the shared Aeron 
stream) before decoding and `InboundHandshake`, so the receiver cannot tell 
which connection a message came from.
   - Quarantining by uid would also cut off the healthy association.
   - The receiver cannot tell the colliding peer to stop: its outbound 
handshake to that peer never completes, so control messages to it are held back.
   
   This is not new: before #3652 the same collision surfaced as an 
`IllegalArgumentException` in `AssociationRegistry.setUID`. #3652 makes 
collisions much less likely (uids derived from host, port and timestamps) and 
rejects the colliding handshake cleanly.
   
   ### Possible directions
   - Let the receiver identify the peer independently of the uid, e.g. by 
adding the sender's address to the handshake or the envelope header. This 
changes the wire format, so it needs a rolling-upgrade plan.
   - A way for the receiver to make the colliding peer drop its association 
(e.g. a reply to the colliding `HandshakeRsp`/`HandshakeReq` that does not 
depend on a completed outbound handshake).
   
   ### References
   - #3652 review discussion: 
https://github.com/apache/pekko/pull/3652#discussion_r4355885614
   


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