modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceFactoryManager.java
| 84 +++++++---
modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
| 2
2 files changed, 60 insertions(+), 26 deletions(-)
New commits:
commit 68414c5dda7381a72816a8754151c62e4ad29541
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed May 25 17:11:35 2011 -0400
Add missing element terminator.
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
index d589fa8..94d9621 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
+++ b/modules/enterprise/gui/coregui/src/main/webapp/CoreGUI.html
@@ -8,7 +8,7 @@
Note, when building the app, you must include the "ie6" gwt.userAgent
since we're emulating IE7 (which
requires the "ie6" userAgent.
-->
- <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"
>
+ <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"
/>
<!-- support internationalized characters -->
<meta http-equiv="Content-Type"
content="text/html;charset=UTF-8" />
commit c4432f792961c2ce406cf0f9a0be4847842260f7
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed May 25 17:11:05 2011 -0400
[BZ 707759 - Deployment of new WAR to EAP server fails due to thread timeout - Need
configurable thread timeout]
Provide overrides for the default 60 second timeout of create and
delete child actions.
In general 60s may be enough but for applications that need time to deploy,
or perhaps to shut down gracefully, this can be too short. The overrides
are blunt in that they affect all types. And it should be noted that while
creating(deploying) or deleting the child resource, the parent resource will
be write-locked, meaning deferred metric reporting etc. So, it it recommended
that when possible fast create and delete is performed for these facet
implementations.
diff --git
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceFactoryManager.java
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceFactoryManager.java
index 161596e..cd0bfcc 100644
---
a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceFactoryManager.java
+++
b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/ResourceFactoryManager.java
@@ -1,25 +1,25 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.rhq.core.pc.inventory;
import java.util.Set;
@@ -62,7 +62,41 @@ import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
* @author Jason Dobies
*/
public class ResourceFactoryManager extends AgentService implements ContainerService,
ResourceFactoryAgentService {
- private static final int FACET_METHOD_TIMEOUT = 60 * 1000; // 60 seconds
+
+ // This used to be a single value fixed at 60 seconds. But create and delete actions
can very well exceed 1 minute
+ // depending on the type of resource being created, or perhaps graceful shutdown of a
resource being deleted. So,
+ // allow the timeout value to be overriden by editing rhq-agent-env.sh with new -D
settings. Also, create separate
+ // timeouts for create and delete, as their execution times really are not related.
The properties are set in
+ // milliseconds:
+ // rhq.agent.plugins.facet.create-child-resource.timeout
+ // rhq.agent.plugins.facet.delete-resource.timeout
+ //
+ // The default is still 60s. Note that increasing this value affects all types
across all plugins and should not
+ // be raised unless a successful create or delete action requires the higher limit.
Realize that while a
+ // create or delete is in progress that the resource is write-locked, so no other
actions can take place (like
+ // metric collection).
+ //
+ // TODO: Add a timeout to the create resource wizard that can be set as an override
for a single create action.
+ private static final int FACET_CREATE_TIMEOUT;
+ private static final int FACET_DELETE_TIMEOUT;
+
+ static {
+ int timeout;
+ try {
+ timeout =
Integer.parseInt(System.getProperty("rhq.agent.plugins.facet.create-child-resource.timeout",
+ "60000"));
+ } catch (Throwable t) {
+ timeout = 60 * 1000;
+ }
+ FACET_CREATE_TIMEOUT = timeout;
+
+ try {
+ timeout =
Integer.parseInt(System.getProperty("rhq.agent.plugins.facet.delete-resource.timeout",
"60000"));
+ } catch (Throwable t) {
+ timeout = 60 * 1000;
+ }
+ FACET_DELETE_TIMEOUT = timeout;
+ }
// Attributes --------------------------------------------
@@ -235,7 +269,7 @@ public class ResourceFactoryManager extends AgentService implements
ContainerSer
*/
private DeleteResourceFacet getDeleteResourceFacet(int resourceId) throws
PluginContainerException {
DeleteResourceFacet facet = ComponentUtil.getComponent(resourceId,
DeleteResourceFacet.class,
- FacetLockType.WRITE, FACET_METHOD_TIMEOUT, false, true);
+ FacetLockType.WRITE, FACET_DELETE_TIMEOUT, false, true);
return facet;
}
@@ -251,7 +285,7 @@ public class ResourceFactoryManager extends AgentService implements
ContainerSer
*/
private CreateChildResourceFacet getCreateChildResourceFacet(int parentResourceId)
throws PluginContainerException {
CreateChildResourceFacet facet = ComponentUtil.getComponent(parentResourceId,
CreateChildResourceFacet.class,
- FacetLockType.WRITE, FACET_METHOD_TIMEOUT, false, true);
+ FacetLockType.WRITE, FACET_CREATE_TIMEOUT, false, true);
return facet;
}