2 Replies Latest reply: Sep 29, 2010 12:32 PM by Trevor Pounds (JIRA) RSS
  • 1. [JIRA] Commented: (SIGAR-227) Invalid file causes      org.hyperic.sigar.FileWatcher.add to fail before list is fully      processed
    Currently Being Moderated

        [ http://jira.hyperic.com/browse/SIGAR-227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=124080#action_124080 ]

    Trevor Pounds commented on SIGAR-227:
    -------------------------------------

    Sorry for the weird formatting in the description.  It looks like text formatting is not enabled for the JIRA description content.

    > Invalid file causes org.hyperic.sigar.FileWatcher.add to fail before list is fully processed
    > --------------------------------------------------------------------------------------------
    >
    >                 Key: SIGAR-227
    >                 URL: http://jira.hyperic.com/browse/SIGAR-227
    >             Project: Sigar
    >          Issue Type: Bug
    >    Affects Versions: 1.6.4
    >            Reporter: Trevor Pounds
    >            Assignee: Doug MacEachern
    >            Priority: Major
    >
    > The org.hyperic.sigar.FileWatcher class will fail to add the full list of files if a file is invalid. The invalid file causes the loop within org.hyperic.sigar.FileWatcher.add(File[]) to abort with org.hyperic.sigar.SigarFileNotFoundException before the remaining files in the list are tried.
    > The following code can be used to exhibit the bug.
    > {code:java}
    > try {
    >    FileWatcher watcher = new FileWatcher();
    >    watcher.add(new String[] { "BAD_FILE", "GOOD_FILE" });
    > } catch (SigarFileNotFoundException e)
    >    e.printStackTrace();
    > }
    > {code}
    > Which results in the following stack trace.
    > {noformat}
    > org.hyperic.sigar.SigarFileNotFoundException: BAD_FILE: No such file or directory
    >         at org.hyperic.sigar.FileAttrs.gather(Native Method)
    >         at org.hyperic.sigar.FileInfo.fetchInfo(FileInfo.java:432)
    >         at org.hyperic.sigar.FileInfo.fetchFileInfo(FileInfo.java:452)
    >         at org.hyperic.sigar.Sigar.getFileInfo(Sigar.java:731)
    >         at org.hyperic.sigar.FileWatcher.add(FileWatcher.java:63)
    >         at org.hyperic.sigar.FileTail.add(FileTail.java:92)
    >         at org.hyperic.sigar.FileWatcher.add(FileWatcher.java:78)
    >         ...
    > {noformat}

    --
    This message is automatically generated by JIRA.
    -
    If you think it was sent incorrectly contact one of the administrators: http://jira.hyperic.com/secure/Administrators.jspa
    -
    For more information on JIRA, see: http://www.atlassian.com/software/jira

           
  • 2. [JIRA] Updated: (SIGAR-227) Invalid file causes      org.hyperic.sigar.FileWatcher.add to fail before list is fully      processed
    Currently Being Moderated

         [ http://jira.hyperic.com/browse/SIGAR-227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Trevor Pounds updated SIGAR-227:
    --------------------------------

        Attachment: SIGAR-227.diff

    Attaching the patch fix here and a link to an upstream github/pull request from my SIGAR fork @ http://github.com/tpounds/sigar/commit/10dffbabcca8acb137e410331ede37f1c63f9d82.

    > Invalid file causes org.hyperic.sigar.FileWatcher.add to fail before list is fully processed
    > --------------------------------------------------------------------------------------------
    >
    >                 Key: SIGAR-227
    >                 URL: http://jira.hyperic.com/browse/SIGAR-227
    >             Project: Sigar
    >          Issue Type: Bug
    >    Affects Versions: 1.6.4
    >            Reporter: Trevor Pounds
    >            Assignee: Doug MacEachern
    >            Priority: Major
    >         Attachments: SIGAR-227.diff
    >
    >
    > The org.hyperic.sigar.FileWatcher class will fail to add the full list of files if a file is invalid. The invalid file causes the loop within org.hyperic.sigar.FileWatcher.add(File[]) to abort with org.hyperic.sigar.SigarFileNotFoundException before the remaining files in the list are tried.
    > The following code can be used to exhibit the bug.
    > {code:java}
    > try {
    >    FileWatcher watcher = new FileWatcher();
    >    watcher.add(new String[] { "BAD_FILE", "GOOD_FILE" });
    > } catch (SigarFileNotFoundException e)
    >    e.printStackTrace();
    > }
    > {code}
    > Which results in the following stack trace.
    > {noformat}
    > org.hyperic.sigar.SigarFileNotFoundException: BAD_FILE: No such file or directory
    >         at org.hyperic.sigar.FileAttrs.gather(Native Method)
    >         at org.hyperic.sigar.FileInfo.fetchInfo(FileInfo.java:432)
    >         at org.hyperic.sigar.FileInfo.fetchFileInfo(FileInfo.java:452)
    >         at org.hyperic.sigar.Sigar.getFileInfo(Sigar.java:731)
    >         at org.hyperic.sigar.FileWatcher.add(FileWatcher.java:63)
    >         at org.hyperic.sigar.FileTail.add(FileTail.java:92)
    >         at org.hyperic.sigar.FileWatcher.add(FileWatcher.java:78)
    >         ...
    > {noformat}

    --
    This message is automatically generated by JIRA.
    -
    If you think it was sent incorrectly contact one of the administrators: http://jira.hyperic.com/secure/Administrators.jspa
    -
    For more information on JIRA, see: http://www.atlassian.com/software/jira

           

More Like This

  • Retrieving data ...

Share This Page