Configuration reload does not apply changes to location rules
Concerned version
Version: %2.0 Platform: Nginx / FastCGI on 2.0.x, did not happen in 1.9
Summary
-
Change the default rule for any handler VHost, including he manager
- After the configuration reload (and $checkTime), the modification is taken into account both in the portal app list and in actual requests
-
Change a location rule that is not the default one (it can be a simple rule on
^/
)- after the configuration reload, the modification is NOT taken into account. The portal will not show the configuration change in the app menu, and the handler will not apply the change.
I have tried:
- Reloading with http://reload.example.com/reload
- Logging off and logging the affected user back on
- "Refresh my rights"
- clearing my cookies
- rm -fr /tmp/lemonldap-ng-sessions
- Sacrificing a goat born under the last full moon to the Great Tsathoggua
But only a process restart was enough to actually apply a configuration change to non-default location rules.
Logs
I noticed that during a configuration reload, new rules keep being added to
$tsv->locationCondition
Here it is after a restart:
'manager.example.com' => [
sub { "DUMMY" }
],
Containing the lone sub compiled from my test rule (^/ => accept)
But after a few reloads, here is what it looks like:
'manager.example.com' => [
sub { "DUMMY" },
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0],
$VAR1->{'manager.example.com'}[0]
],
The code in locationRulesInit
does not seem to ever delete anything from this array. From a casual glance it seems to me like the configuration reload just piles the new rules on top of the old ones, which might explain why the old rules are still being applied. Furthermore this looks like a potential memory leak too.