This is a deep cut, but the following line is not optimal: $self->plugin( 'Mojolicious::Plugin::OAuth2' => $oauth_configuration ); Mojolicious will first try to load that as Mojolicious::Plugin::Mojolicious::Plugin::OAuth2 before it realises that we've already loaded Mojolicious::Plugin::OAuth2 earlier in Koha::REST::V1. I reckon that should say: $self->plugin( 'OAuth2' => $oauth_configuration ); -- In the grand scheme of things, it's not a big deal, but we can save ourselves 26 system calls by changing 1 line.
Created attachment 178304 [details] [review] Bug 39160: Use optimal Mojolicious plugin name This change uses "OAuth2" instead of "Mojolicious::Plugin::OAuth2" when setting the plugin, so that Mojolicious can find the plugin faster. Test plan: 0. Apply the patch 1. koha-plack --restart kohadev 2. Run through "Testing SSO" from the Koha Wiki 3. Confirm that you can log into Koha using the Keycloak OIDC
If you *really* want to confirm this does what I say it does, you're going to have to use "strace" to examine the kernel syscalls the starman worker is making when it starts up. Specifically, you'll be looking to make sure that it doesn't do things like this: newfstatat(AT_FDCWD, "/usr/local/lib/site_perl/Mojolicious/Plugin/Mojolicious/Plugin/OAuth2.pm", 0x7ffd205204e0, 0) = -1 ENOENT (No such file or directory)