Created attachment 959662 [details]
Description of problem:
If I disable collecting availability metric on resource, the metric is still collected.
Version-Release number of selected component (if applicable):
Build Number : f8f6447:6a2b52e
How reproducible: always
Steps to Reproduce:
1. have a resource which is UP (i.e. AS7 server)
2. disable availability metric on this resource
3. shutdown your AS7 server
After step #2 availability is still collected. Resource seems still to be UP and also in UI when you expand availability stats. After step #3 resource is suddenly reported as DOWN - which is another indicator, that availability is still being collected
After step #2 resource could indicate availability = UP (inherits from parent), but at least in avail stats, there must be values indicating disabled availability, when managed resource goes down, this must not affect resource availability, availability must NOT be collected on agent.
This is normal. Disabling the availability metric just makes it defer to the parent's availability, which means it takes no resources. This is not a bug, working as expected.
OK, I apologize, I didn't read this closely enough. The reason you see what you see is because you navigated to the resource in the UI. For the UI-focused resource we perform live avail checks every 15s. This bypasses the scheduled avail checks, which are in fact deferring to the parent.
I could see how this might be confusing because the live avail and the scheduled avail could actually differ.
Having said that, I'm not really sure the current behavior is bad, as at least in the UI, where you are likely quite interested in the resource, you will see the proper avail, and it's not actually scheduled metric collection.
It will be up to others to decide if this is a problem and if the UI call should consider the "disabled" state.
One more thing, to be clear, the DISABLED availability is reported *only when the resource is disabled*. Disabling the avail metric only affects the avail reporting by deferring to the parent, the avail will still be UP or DOWN.
This buggy behaviour is caused by UI avail checks. When an immediate avail check is done via UI, avail check was performed and left signs of enabled avail schedule in ResourceContainer memory, which switched on collecting disabled availability on agent. Agent restart would of course re-set schedule to "correctly disabled", and also there is a chance of missing UI avail check when disabling schedule, so one could observe correct behaviour.
As disscussed with Jay, correct way (and fix) is NOT to perform avail check in case of immediate avail check request. This means .. if availability metric is disabled, agent always defers to parent (including immediate check).
time: 2014-11-25 21:27:23 +0100
author: Libor Zoubek - email@example.com
message: Bug 1166640 - Disabling availability metric has no effect
Do not forceRootScan when resource's avail schedule is
currently disabled. Also fix CustomScanRootAvailabilityExecutor
to clean up availabilityScheduleTime in case it is ever used
with forceRootScan=true on resource with avail schedule
Cherry-picked to release/jon3.3.x:
Author: Libor Zoubek <firstname.lastname@example.org>
Date: Tue Nov 25 17:39:59 2014 +0100
Bug 1166640 - Disabling availability metric has no effect
Do not forceRootScan when resource's avail schedule is currently disabled.
Also fix CustomScanRootAvailabilityExecutor to clean up
availabilityScheduleTime in case it is ever used with forceRootScan=true on
resource with avail schedule disabled
(cherry picked from commit e43c4d9d38270073cba398c2a3d08f7ad9d6be7d)
Moving to ON_QA as available for test with the latest 3.3.1.ER01 bits from here:
Verified on 3.3.0.GA Update 01. Verified that after steps 3, after disabling the availability metric and when managed resource goes down, the resource shows availability up.
Resource availability remains up after executing avail scan operation on agent.