[
https://issues.apache.org/jira/browse/ARTEMIS-2708?focusedWorklogId=421693&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-421693
]
ASF GitHub Bot logged work on ARTEMIS-2708:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 13/Apr/20 22:10
Start Date: 13/Apr/20 22:10
Worklog Time Spent: 10m
Work Description: michaelandrepearce commented on pull request #3078:
ARTEMIS-2708 JDK bug causes missed props reload
URL: https://github.com/apache/activemq-artemis/pull/3078#discussion_r407749322
##########
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:
Just a note here wont this break / cause file to be repeatedly reloaded once
the jdk bug is fixed? Is this fixed in 11?
Is it worth adding some check to jdk version? Before doing the workaround so
only do workaround on broken jdk versions
----------------------------------------------------------------
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: 421693)
Time Spent: 40m (was: 0.5h)
> 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: 40m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)