pat-lego commented on PR #31:
URL: 
https://github.com/apache/sling-org-apache-sling-event/pull/31#issuecomment-1613237257

   @sagarmiglani logically you are correct but you are missing one critical 
piece of information. There are scenarios that cause events to already register 
this mbean and at times this code fires after this mbean has already been 
registered. We have just recently witnessed this.
   
   This infinite loop causes a stackoverflow error and because of this can 
cause eventually cause a deadlock in the system because the necessary finally 
block is never called to release any of the necessary semaphores that are 
acquired higher in the call stack. 
   
   In my professional opinion, recursion with no way out (no base case) is a 
poor design and will lead to issues that we have just witnessed.
   
   If we want to try and perform a different way to prevent a collision that is 
fine but the main issue here is that we have recursion that theoretically can 
never end. This is the critical issue because when you get stack overflow 
errors the function can never complete, finally blocks do not get called and 
resources never get released which cause system deadlocks.


-- 
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: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to