You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "pat-lego (via GitHub)" <gi...@apache.org> on 2023/06/29 14:00:53 UTC

[GitHub] [sling-org-apache-sling-event] pat-lego commented on pull request #31: Fix infinite recursion issue: SLING-11918

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-unsubscribe@sling.apache.org

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