RFR: 8273026: Slow LoginContext.login() on multi threading application [v5]

Larry-N duke at openjdk.java.net
Thu Oct 28 15:39:18 UTC 2021


On Wed, 27 Oct 2021 20:08:34 GMT, Larry-N <duke at openjdk.java.net> wrote:

>> This fix adds a cache of service provider classes to LoginContext (in particular, it's a cache of LoginModules classes). The approach helps to increase the performance of the LoginContext.login() method significantly, especially in a multi-threading environment. Service Loader is used for polling on Service Provider classes, without instantiating LoginModules object if Service Provider name doesn't match record in .config file. The set of service providers is cached for each Context Loader separately.
>> This code passed successfully tier1 and tier2 tests on mac os.
>
> Larry-N has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Trailing spaces

Probably i do something wrong, but I've removed the isLoaded from both login modules classes, so the test looks like this:

 * @build FirstLoginModule
 * @run main/othervm/fail Loader
 * @build SecondLoginModule
 * @run main/othervm Loader
 */
public class Loader {

    public static void main(String[] args) throws Exception {

        System.setProperty("java.security.auth.login.config",
                new File(System.getProperty("test.src"), "sl.conf").toString());
        LoginContext lc = new LoginContext("me");

        lc.login();

    }
}

and the jtreg says: 
Failed. Execution passed unexpectedly:

-------------

PR: https://git.openjdk.java.net/jdk/pull/5748



More information about the security-dev mailing list