Updates on strings.properties are not propagated when using the WebUI on a different server

Description

When the collector server updates a strings.properties file, those updates are not being propagated to the WebUI server when going to the Resource Graphs from the node's page.

I believe that the reason is because there are two different instances of ResourceTypeUtils running on different JVMs, and of course, they are using different caches, and they are not being synchronized.

In order to avoid increase the load and/or decrease the performance of the cache of ResourceTypeUtils, one solution might be create a special variable on opennms.properties in order to instruct ResourceTypeUtils to behave differently when OpenNMS is running only as a WebUI server.

This change is basically going to verify the lastModifyTime of the strings.properties files in order to know if the file has changed when a class is requesting a value of a specific property through ResourceTypeUtils.

Environment

Have two OpenNMS servers: one for the WebUI only and other for the rest of services.

Acceptance / Success Criteria

None

Attachments

1
  • 15 Apr 2013, 10:00 AM

Lucidchart Diagrams

Activity

Show:

Alejandro Galue April 15, 2013 at 10:00 AM

Fixed on revision d2afa8a1525f7a0c525e533d28621aade4d52286 for 1.10, and merged back to 1.12 on revision 8152a1505db27a137c359e0d61869778fcfe6f71.

Alejandro Galue April 10, 2013 at 8:31 AM

I'm attaching the proposed patch. Basically I've added two fields to PropertiesCache and an optional validation depending on a system variable called org.opennms.utils.propertiesCache.enableCheckingFileModified.

I'm still trying to figure it out if this is the best solution, and if it is not going to introduce performance issues if this optional validation is not used.

I've also migrated the JUnit tests for ResourceTypeUtils from JUnit3 to JUnit4, and I've added a test to prove that the solution works.

Fixed

Details

Assignee

Reporter

Labels

Fix versions

Affects versions

Priority

PagerDuty

Created April 8, 2013 at 11:44 AM
Updated January 27, 2017 at 4:20 PM
Resolved April 15, 2013 at 10:00 AM

Flag notifications