summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Negrea <snegrea@redhat.com>2012-08-13 20:27:23 (GMT)
committerStefan Negrea <snegrea@redhat.com>2012-08-13 20:27:23 (GMT)
commit33f5f3e4d9fe4ab9e75bf78add28eedf7db22be9 (patch)
treee19f7119ce77c9808303544f193c3ee0628f9e96
parenta2e555ff6f1b375a88abebe111fcc603625e0f1e (diff)
downloadrhq-33f5f3e4d9fe4ab9e75bf78add28eedf7db22be9.zip
rhq-33f5f3e4d9fe4ab9e75bf78add28eedf7db22be9.tar.gz
rhq-33f5f3e4d9fe4ab9e75bf78add28eedf7db22be9.tar.xz
[BZ 847674] Prevent exceptions from bubbling up because that is an indication the server is still down after the restart. Consider a thrown exception just a failed attempt to connect to the server, equivalent to success == false response for the test operation.
(cherry picked from commit 1b2ba60b043c4c9e8feff247dcb0b53f342b9371)
-rw-r--r--modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
index 8b85deb..75bc091 100644
--- a/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
+++ b/modules/plugins/jboss-as-7/src/main/java/org/rhq/modules/plugins/jbossas7/BaseServerComponent.java
@@ -406,12 +406,19 @@ public abstract class BaseServerComponent<T extends ResourceComponent<?>> extend
int count = 0;
while (!up) {
Operation op = new ReadAttribute(new Address(), "release-version");
- Result res = getASConnection().execute(op);
- if (res.isSuccess()) { // If op succeeds, server is not down
- up = true;
- } else if (count > 20) {
- break;
+ try{
+ Result res = getASConnection().execute(op);
+ if (res.isSuccess()) { // If op succeeds, server is not down
+ up = true;
+ } else if (count > 20) {
+ break;
+ }
+ } catch (Exception e) {
+ //do absolutely nothing
+ //if an exception is thrown that means the server is still down, so consider this
+ //a single failed attempt, equivalent to res.isSuccess == false
}
+
if (!up) {
try {
Thread.sleep(1000); // Wait 1s