[
https://issues.apache.org/jira/browse/ARTEMIS-2708?focusedWorklogId=421753&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-421753
]
ASF GitHub Bot logged work on ARTEMIS-2708:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 13/Apr/20 23:54
Start Date: 13/Apr/20 23:54
Worklog Time Spent: 10m
Work Description: jbertram commented on pull request #3078: ARTEMIS-2708
JDK bug causes missed props reload
URL: https://github.com/apache/activemq-artemis/pull/3078#discussion_r407785265
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/ReloadableProperties.java
##########
@@ -137,7 +137,14 @@ private void load(final File source, Properties props)
throws IOException {
}
private boolean hasModificationAfter(long reloadTime) {
- return key.file.lastModified() > reloadTime;
+ /**
+ * A bug in JDK 8/9 (i.e.
https://bugs.openjdk.java.net/browse/JDK-8177809) causes
java.io.File.lastModified() to
+ * lose resolution past 1 second. Because of this, the value returned by
java.io.File.lastModified() can appear to
+ * be smaller than it actually is which can cause the broker to miss
reloading the properties if the modification
+ * happens close to another "reload" event (e.g. initial loading). In
order to *not* miss file modifications that
+ * need to be reloaded we artificially inflate the value returned by
java.io.File.lastModified() by 1 second.
+ */
Review comment:
No, it won't break. The worst that will happen is that the file might be
reloaded a few more times than necessary which will take more time relatively
speaking but really shouldn't be a big deal.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 421753)
Time Spent: 50m (was: 40m)
> JDK bug causes missed properties reload
> ---------------------------------------
>
> Key: ARTEMIS-2708
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2708
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: Justin Bertram
> Assignee: Justin Bertram
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)