Bug 736204 - Drift detection task stops running when base directory does not exist
Summary: Drift detection task stops running when base directory does not exist
Status: CLOSED DUPLICATE of bug 751912
Alias: None
Product: RHQ Project
Classification: Other
Component: drift
Version: 4.1
Hardware: Unspecified
OS: Unspecified
unspecified vote
Target Milestone: ---
: ---
Assignee: John Sanda
QA Contact: Mike Foley
Depends On:
Blocks: 707225
TreeView+ depends on / blocked
Reported: 2011-09-07 01:56 UTC by John Sanda
Modified: 2011-11-11 22:33 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-11-11 22:33:47 UTC

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 736208 0 high CLOSED Agent needs to clean up when unexpected error occurs during drift detection 2021-02-22 00:41:40 UTC

Internal Links: 736208

Description John Sanda 2011-09-07 01:56:33 UTC
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 23:29:03 UTC
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 19:50:46 UTC
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 15:29:50 UTC
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 22:33:47 UTC
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.