Possible Mismatch Between the Real LDAP Import Time and Import Interval Set on Instance Settings after LPS-98420

Issue

After LPS-98420, there might be a mismatch between the real LDAP Import trigger time and Import Interval set on instance settings.

For example:

  1. Set “System Settings -> LDAP -> Import Interval” to 2.
  2. Set “Instance Settings -> LDAP -> Import Interval” to 3.

Expected Result: The import trigger time is 3 minutes.

Actual Result: The real import trigger time is 4 minutes.

Reason

The 'LDAP Import Interval' setting exists on both System Settings level and Instance Settings level.

The 'LDAP Import Interval' on System Settings level, after LPS-98420, is considered a trigger timer. Instead of triggering the LDAP Import, the 'LDAP Import Interval' on System settings level is used to trigger a check of whether or not there are any instances due for an import.

The 'LDAP Import Interval' on Instance Settings level, could be considered the real import trigger interval. However, you must consider the 'LDAP Import Interval' on Instance Settings together with the Interval on System Settings to determine the real LDAP Import time.

As in the example, if the System Settings LDAP Import Interval is 2 minutes, this means every 2 minutes, it will check if there are any instances which have LDAP import enabled and are due for another import. Let's say LDAP is enabled and has an import interval of 3 minutes in the default Liferay Instance Settings. The user may expect the LDAP Import occurs every 3 minutes (as set in the Instance Settings).

However, due to the changes in LPS-98420, in this scenario Liferay will check whether or not there are any instances due for another import every 2 minutes but the import will not occur because it is set to take place every 3 minutes past the "last import time" (Instance Settings Level).  While the instance is ready for import at 3 minutes, it cannot trigger itself and must wait for the scheduler to do so.  Therefore, the actual import will not occur until the next triggered check, thus making the real LDAP Import time on the second trigger, at 4 minutes.  

Resolution

In single-instance bundles, it's best to match the System and Instance settings' interval values, so import is triggered and executed exactly as needed. In multi-instance bundles, specifically where LDAP import intervals need to vary, it's best to set the System interval as the lowest common denominator of the instances.

Take the example of a two-instance bundle where Instance A has an interval of 20 minutes and Instance B has an interval of 30 minutes. You would want to set the System interval to 10 minutes, which is the lowest common denominator of the two. The LDAP importer will trigger at 10 (no imports), 20 (Instance A), and 30 (instance B) minutes, and so on. This ensures both instances execute importation at their specified times.

Was this article helpful?
2 out of 2 found this helpful