Bug 798006 - Drift detection hangs on reading named pipes on filesystem
Summary: Drift detection hangs on reading named pipes on filesystem
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Drift
Version: JON 3.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER01
: JON 3.3.0
Assignee: Jay Shaughnessy
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 880815
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-27 19:38 UTC by Mike Foley
Modified: 2014-12-11 14:00 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 880815 (view as bug list)
Environment:
Last Closed: 2014-12-11 14:00:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mike Foley 2012-02-27 19:38:32 UTC
Description of problem:  Drift detection hangs on special 'fifo' files with 'prw' file permissions.  Issue detected as part of verifying https://bugzilla.redhat.com/show_bug.cgi?id=789454


Version-Release number of selected component (if applicable):  JON 3.01


How reproducible:  100% by mfoley and jshaughn


Steps to Reproduce:
1.  Setup a Drift Definition on a directory, such as '/tmp' that contains files with permissions 'prw'

2.  Click the button to detect drift.
3.  Drift hangs.  Snapshot #0 is never created.
  
Actual results:  Drift detection hangs.


Expected results:  Snapshot #0 is created and problematic filetypes are avoided in a robust manner.


Additional info:

[root@foleymonsterbox1 icedteaplugin-mfoley]# ls -al
<mfoley> total 24
<mfoley> drwx------.  2 mfoley mfoley  4096 Jan 13 16:40 .
<mfoley> drwxrwxrwt. 42 root   root   20480 Feb 27 13:23 ..
<mfoley> prw-------.  1 mfoley mfoley     0 Jul 12  2011 24966-icedteanp-appletviewer-to-plugin
<mfoley> prw-------.  1 mfoley mfoley     0 Jul 12  2011 24966-icedteanp-plugin-to-appletviewer
<mfoley> prw-------.  1 mfoley mfoley     0 Jun  2  2011 2564-icedteanp-appletviewer-to-plugin
<mfoley> prw-------.  1 mfoley mfoley     0 Jun  2  2011 2564-icedteanp-plugin-to-appletviewer
<mfoley> prw-------.  1 mfoley mfoley     0 Jan 13 16:44 29849-icedteanp-appletviewer-to-plugin
<mfoley> prw-------.  1 mfoley mfoley     0 Jan 13 16:44 29849-icedteanp-plugin-to-appletviewer

Comment 1 Mike Foley 2012-02-27 22:05:53 UTC
this is an edge case that can be avoided with includes/excludes ... in the unlikely situation that someone wants to monitor a directory with these unusual file types 

preliminary discussion with developer indicated the fix could be a bit heavy-handed to open every file to see if it is actually readable (btw, trying to read this named pipe file is what causes drift to hang) 

re inclusion into JON 3.01 (we are past code freeze now, and in the endgame) 
-is it a regression?  NO
-is it a customer issue?  NO
-is it urgent?
-is it a main line primary use-case?  NO


ergo, recommend a push of target release to jon 3.1 or later.

Comment 3 Mike Foley 2012-02-27 23:51:46 UTC
documenting that i tested drift on directories with symbolic links ... and that worked.

Comment 4 Mike Foley 2012-03-05 16:39:56 UTC
JON 3.1 medium priority, per triage meeting (crouch, foley, loleary)

Comment 5 Ian Springer 2012-05-14 21:08:26 UTC
I think the solution to this, would be to change th following code in DriftDetector.doDirectoryScan():


  if (!file.canRead()) {
                            if (log.isDebugEnabled()) {
                                log.debug("Skipping " + file.getPath() + " since we do not have read access.");
                            }
                            return;
                        }

to:

  if (!file.isFile()) {
                            if (log.isDebugEnabled()) {
                                log.debug("Skipping " + file.getPath() + " since it is not a regular file.");
                            }
                            return;
                        }

Since File.isFile() should only return true for regular files or symlinks to regular files, which I believe are the only things we care about.

I'm assigning this to Jay, since he worked on the related bug 789454, so he can comment.

Comment 7 Jay Shaughnessy 2014-04-21 20:39:33 UTC
commit 7e9ce1d0a3953248a7dcc66b2025447b1cf1a019
Author: Jay Shaughnessy <jshaughn>
Date:   Mon Apr 21 16:37:35 2014 -0400

    Protect against drift detection on not "normal" files.

Comment 8 Simeon Pinder 2014-07-31 15:52:09 UTC
Moving to ON_QA as available to test with brew build of DR01: https://brewweb.devel.redhat.com//buildinfo?buildID=373993

Comment 9 Mike Foley 2014-08-05 18:31:45 UTC
failed qe.

the drift feature is broken in jon 3.3


Note You need to log in before you can comment on or make changes to this bug.