[AAA-171] Remove KarafIniWebEnvironmentLoaderListener to avoid deadlock at org.opendaylight.aaa.shiro.web.env.KarafIniWebEnvironment.init() CompletableFuture.get Created: 16/Mar/18  Updated: 27/Mar/23  Resolved: 04/Mar/23

Status: Resolved
Project: aaa
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Michael Vorburger Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File jstack.txt     Text File jstack2.txt     Text File jstack3.txt     File karaf.log    

 Description   

Following https://git.opendaylight.org/gerrit/#/c/69415/ (I think), and in development of https://git.opendaylight.org/gerrit/#/c/68767/ Patch Set 5 after having gotten AAA-170 out of the way, the SFT of odl-neutron-service deadlocks (see attached x3 jstack*.txt) in org.opendaylight.aaa.shiro.web.env.KarafIniWebEnvironment.init() when waiting for CompletableFuture.get, without any other relevant errors in karaf.log.

Before anyone (Ryan) jumps in and starts reverting stuff, and because this is only seen in a not yet merged in dev Gerrit in Neutron, we should better understand what is really going on here - because AAA itself does seem to work; I suspect I may have made a mistake in Neutron, but I don't see which.



 Comments   
Comment by Michael Vorburger [ 04/Apr/18 ]

Hit this again in https://git.opendaylight.org/gerrit/#/c/68767/ ... it seems that the programmatic use of the @Deprecated :

.addListener(new KarafIniWebEnvironmentLoaderListener())

in a typical WebInitializer kind of class leads to this deadlock in the @Deprecated KarafIniWebEnvironment, at least some times; not sure if always.

This problem gets fixed (doesn't happen anymore) in https://git.opendaylight.org/gerrit/#/c/69566/ (which extends c/68767), because that, via the WebContextSecurer interface and ShiroWebContextSecurer impl, uses the ShiroWebEnvironmentLoaderListener instead of the KarafIniWebEnvironmentLoaderListener, and therefore the AAAIniWebEnvironment instead of the KarafIniWebEnvironment. This AAAIniWebEnvironment does not (have to) use AAAShiroProvider.INSTANCE_FUTURE.get() anymore, which is what's causing this deadlock.

To move forward in Neutron for the short-term, I've combined c/68767 and c/69566 into c/70339 to go directly from web.xml to the new programmatic registration including WebContextSecurer (the 2 split changes where just to illustrate; my goal was always both).

In the medium term, ideally still for the Fluorine release, we should probably compeltely remove the KarafIniWebEnvironmentLoaderListener and KarafIniWebEnvironment ... once we have switched over all projects requiring AAA from web.xml to the new programmatic registration mechanism.

Generated at Wed Feb 07 19:08:49 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.