Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-3746

File setLastModified() in deployment code causes problems

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 1.4, nightly
    • deployment
    • None

    Description

      I question the usage of the the File class's method setLastModified() in WSInfoList.java:

      private void setLastModifiedDate(File file, WSInfo wsInfo) {
      if (file.isDirectory()) {
      File files [] = file.listFiles();
      for (int i = 0; i < files.length; i++) {
      File fileItem = files[i];
      if (fileItem.isDirectory())

      { setLastModifiedDate(fileItem, wsInfo); }

      else

      { fileItem.setLastModified(wsInfo.getLastModifiedDate()); }

      }
      } else

      { file.setLastModified(wsInfo.getLastModifiedDate()); }

      }

      I do not understand why we are actually modifying the last-modified-date of the file objects?

      The main reason is that this causes problems when the user ID that AXIS2 is running under does not have authority to update the files. So the attempt to modify the files will not result on anything be done (we apparently do not check if operation failed), but more importantly, if system auditing is enabled you will see authority-failure auditing records for each attempt to modify the time-stamp for a file. And if hot-update is deployed, this will result in 1000's of these records.

      Possible solution: Why do we need to test for equality when looking at time-stamps? We can save the newest last-modified time-stamp, and then when we want to detect if something has changed, we simply see if the saved time-stamp is greater or equal to the file time-stamp. And if this is true, then the file has not changed. Otherwise, the file has changed.....the added benefit is we do not have to update files.

      I will be fixing this ASAP and hopefully will be getting this into Axis 1.4.

      Attachments

        Activity

          People

            nadiramra Nadir K. Amra
            nadiramra Nadir K. Amra
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: