You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2020/04/13 16:14:17 UTC

[GitHub] [activemq-artemis] jbertram opened a new pull request #3078: ARTEMIS-2708 JDK bug causes missed props reload

jbertram opened a new pull request #3078: ARTEMIS-2708 JDK bug causes missed props reload
URL: https://github.com/apache/activemq-artemis/pull/3078
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] jbertram commented on a change in pull request #3078: ARTEMIS-2708 JDK bug causes missed props reload

Posted by GitBox <gi...@apache.org>.
jbertram commented on a change in 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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] asfgit closed pull request #3078: ARTEMIS-2708 JDK bug causes missed props reload

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #3078: ARTEMIS-2708 JDK bug causes missed props reload
URL: https://github.com/apache/activemq-artemis/pull/3078
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #3078: ARTEMIS-2708 JDK bug causes missed props reload

Posted by GitBox <gi...@apache.org>.
michaelandrepearce commented on a change in 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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [activemq-artemis] michaelandrepearce commented on a change in pull request #3078: ARTEMIS-2708 JDK bug causes missed props reload

Posted by GitBox <gi...@apache.org>.
michaelandrepearce commented on a change in 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 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:
users@infra.apache.org


With regards,
Apache Git Services