asafm commented on PR #20341:
URL: https://github.com/apache/pulsar/pull/20341#issuecomment-1568033761

   I totally understand something was perhaps wrong in the initial design of 
this interceptor interface.
   I see it was introduced in https://github.com/apache/pulsar/pull/8129, so we 
can ask @codelipenghui and @zymap for more context.
   
   Furthermore, I think that it's a must for pulsar service to have the 
interceptors initialized prior to receiving traffic.
   The thing is, you can easily get your self into a deadlock.
   Imagine we have a flag to turn off traffic receiving of any kind, including 
admin API (well, since you have callbacks in the interceptors for that as 
well). Now think that it's off, we initialize interceptors, then we turn on 
flag.
   You decide to create a topic, and it so happens to be located in the same 
broker as you are running at, but you can't service traffic, so it will fail, 
and thus you may not have pulsar start. Deadlock.
   
   IMO, interceptors should a thin element of logic into it. Perhaps it's 
better to have all initialization be performed prior to deployment of it?  I 
know it's not elegant, but I can't think of something better at the moment. 
Maybe @codelipenghui as an idea.
   


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