Bug 736204 - Drift detection task stops running when base directory does not exist
Drift detection task stops running when base directory does not exist
Status: CLOSED DUPLICATE of bug 751912
Product: RHQ Project
Classification: Other
Component: drift (Show other bugs)
Unspecified Unspecified
high Severity unspecified (vote)
: ---
: ---
Assigned To: John Sanda
Mike Foley
Depends On:
Blocks: 707225
  Show dependency treegraph
Reported: 2011-09-06 21:56 EDT by John Sanda
Modified: 2011-11-11 17:33 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2011-11-11 17:33:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Sanda 2011-09-06 21:56:33 EDT
Description of problem:
The drift detector runs on a reoccurring schedule in a thread pool. If an exception occurs during task execution such that it is not handled and propagates out of the task, subsequent executions of the task will be terminated. This happens when a drift configuration has a value for its base directory that evaluates to a non-existent path.

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

How reproducible:
Any time the base directory evaluates to a non-existent path

Steps to Reproduce:
1. Create a drift configuration for a platform resource
2. For the base directory, choose a value that evaluates to a non-existent path
3. Set the interval to a really low value like 10 so that drift detections occurs quickly and frequently.
4. Wait five minutes so that the drift detection will have had time to run twice.
5. Create another drift configuration that is valid such that the base directory evaluates to an existing file system path.
6. Wait a few minutes for the drift detection to run.
Actual results:
Drift detection for the second configuration will never run. Nor will it run for any other configuration because the drift detector task has stopped running.

Expected results:
Drift detection should continue running.

Additional info:
A fix for this has already been committed to the drift branch. The fix makes sure that exceptions do not propagate out of the drift detector task. While the error handling is necessary, I do not think it is sufficient. We need to do some up front validation when a user creates a drift configuration, and we need to make sure we do appropriate clean up on the agent when unexpected errors do occur. I will file separate bugs for these because I think that they can be tested and happen independent of one another.
Comment 1 Charles Crouch 2011-10-04 19:29:03 EDT
The key thing is that one bad drift configuration does not bring all 
configurations down.

I see agent side checking of valid paths as an additional enhancement to this.
Comment 2 John Sanda 2011-10-17 15:50:46 EDT
This bug over laps with bug 738346 and the fix really addresses this one as well. Moving to ON_QA.
Comment 3 Mike Foley 2011-10-18 11:29:50 EDT
The negative test for Drift with an invalid directory is unverifiable ... there are no changesets.  The basic positive use-case does not work for me.
Comment 4 John Sanda 2011-11-11 17:33:47 EST
This overlaps with bug 751912. The fix is twofold. First drift detection continues to run even if the base directory does not exist. Secondly, a non-existent base directory is reported as out of compliance. I am closing this since 751912 was already verified.

*** This bug has been marked as a duplicate of bug 751912 ***

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