m1a2st commented on PR #19527:
URL: https://github.com/apache/kafka/pull/19527#issuecomment-3863984342

   I should add more details for this scenario, although I do not have a 
concrete solution yet.
   
   In the test, we register two different login classes on the external 
listener and the internal listener.
   
   1. External listener
       This case does not have the issue. The external listener is used by 
client connections (admin, producer, and consumer), so it always registers the 
login plugin in `ConnectionMode.SERVER`.
   
   2. Internal listener
       This is where the issue occurs. During broker startup, multiple 
components are initialized. Some of these components act as clients, while 
others act as servers. However, the login plugin is a singleton, meaning only 
one instance exists.
   
      If a component running in `ConnectionMode.SERVER` initializes the login 
plugin first, that instance is stored in memory. When other components start up 
later, they reuse the same login plugin instance from memory. As a result, the 
metric tags depend on which component registers the plugin first.
   
   Since we cannot guarantee the component startup order, the resulting 
behavior is nondeterministic. Modifying the component startup order also seems 
difficult in practice.


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

Reply via email to