Branch: refs/heads/master
Home:
https://github.com/rhq-project/rhq
Commit: 7362e08cf6b53d2f59909af0013559e7a261157f
https://github.com/rhq-project/rhq/commit/7362e08cf6b53d2f59909af0013559e...
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: 2014-08-06 (Wed, 06 Aug 2014)
Changed paths:
M
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerBean.java
Log Message:
-----------
[1126853] Alert does not trigger if defined with 'disable when fired'
This was undetected fallout from the work done in BZ 1110434. Although,
it's fallout that doesn't make a lot of sense. It's either a bug in
HornetQ/Arjuna/EAP interaction Tx management, or we violated some very
subtle J2EE/JTA rule. Basically this is what was happening:
1) alert condition consumer onMessage is invoked (with default CMT Tx semantics)
2) it invokes a series of nested SLSB calls with various Tx semantics, including
REQUIRED, REQUIRES_NEW and NOT_SUPPORTED.
3) The NOT_SUPPORTED method hangs on method return, as such some downstream
processing commits (due to REQUIRES_NEW semantics) but the upstream calls
don't complete. So even though the alerting all worked, it never got
to commit.
4) After 10 minutes the Tx reaper comes along and cancels the hanging Tx.
The fix/workaround is actually easy. Instead of calling the general purpose
disableAlertDefinitions() method (which supports mass-disable and therefore
uses the NOT_SUPPORTED semantics to help chunk transactioning) we switch to
the disableResourceAlertDefinitions() method (which uses REQUIRED) because
we know we are dealing with a single resource-level alert definition.
We make an analogous change for enable. We are basically avoiding the
issue.