Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 870182 Details for
Bug 987628
Agent can block indefinitely at startup if server has an issue
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Indefinite blocking fix; except in some cases
0002-BZ-987628-Agent-can-block-Mars-Rover-behavior-retry-.patch (text/plain), 4.53 KB, created by
Elias Ross
on 2014-03-04 00:14:19 UTC
(
hide
)
Description:
Indefinite blocking fix; except in some cases
Filename:
MIME Type:
Creator:
Elias Ross
Created:
2014-03-04 00:14:19 UTC
Size:
4.53 KB
patch
obsolete
>From d15deac4337781758f7b533fc578ead2f1d69b2b Mon Sep 17 00:00:00 2001 >From: Elias Ross <elias_ross@apple.com> >Date: Wed, 19 Feb 2014 09:45:22 -0800 >Subject: [PATCH 2/2] BZ 987628 - Agent can block; Mars Rover behavior - retry > forever > >This patch makes the agent continue to try to connect, except in these cases: >1) The Agent object fails to construct. >2) The Agent is not the right version and cannot upgrade. >3) The Agent lost its token or has the wrong token >4) 'HelpException' - which happens through the command line interface >--- > .../java/org/rhq/enterprise/agent/AgentMain.java | 43 ++++++++++------------ > 1 file changed, 19 insertions(+), 24 deletions(-) > >diff --git a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java >index 76ca12c..c6f409f 100644 >--- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java >+++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java >@@ -406,10 +406,8 @@ public static void main(String[] args) { > reconfigureJavaLogging(); > > AgentMain agent = null; >- int retries = 0; >- final int MAX_RETRIES = 5; > >- while (retries++ < MAX_RETRIES) { >+ while (true) { > try { > agent = new AgentMain(args); > >@@ -441,43 +439,40 @@ public static void main(String[] args) { > } else { > agent.inputLoop(); > } >- retries = MAX_RETRIES; // no need to retry...we're good to go >+ break; > } catch (HelpException he) { >- retries = MAX_RETRIES; // do nothing but exit the thread >+ break; // do nothing but exit the thread > } catch (AgentNotSupportedException anse) { > LOG.fatal(anse, AgentI18NResourceKeys.AGENT_START_FAILURE); > agent.getOut().println(MSG.getMsg(AgentI18NResourceKeys.AGENT_START_FAILURE)); > anse.printStackTrace(agent.getOut()); >- retries = MAX_RETRIES; // this is unrecoverable, we need this main thread to exit *now* >+ break; // this is unrecoverable, we need this main thread to exit *now* > } catch (AgentRegistrationException e) { > LOG.fatal(e, AgentI18NResourceKeys.AGENT_START_FAILURE); > e.printStackTrace(agent.getOut()); >- retries = MAX_RETRIES; >+ break; > } catch (Exception e) { >- LOG.fatal(e, AgentI18NResourceKeys.AGENT_START_FAILURE); > >- if (agent != null) { >- agent.getOut().println(MSG.getMsg(AgentI18NResourceKeys.AGENT_START_FAILURE)); >- e.printStackTrace(agent.getOut()); >- if (retries < MAX_RETRIES) { >- LOG.error(AgentI18NResourceKeys.AGENT_START_RETRY_AFTER_FAILURE); >- agent.getOut().println(MSG.getMsg(AgentI18NResourceKeys.AGENT_START_RETRY_AFTER_FAILURE)); >- try { >- Thread.sleep(60000L); >- } catch (InterruptedException e1) { >- Thread.currentThread().interrupt(); >- } >- } >- } else { >+ if (agent == null) { >+ LOG.fatal(e, AgentI18NResourceKeys.AGENT_START_FAILURE); > System.err.println(MSG.getMsg(AgentI18NResourceKeys.AGENT_START_FAILURE)); > e.printStackTrace(System.err); >- retries = MAX_RETRIES; // agent could not even be instantiated, this is unrecoverable, just exit >+ break; // agent could not even be instantiated, this is unrecoverable, just exit > } > >- agent = null; >+ LOG.error(e, AgentI18NResourceKeys.AGENT_START_FAILURE); >+ agent.getOut().println(MSG.getMsg(AgentI18NResourceKeys.AGENT_START_FAILURE)); >+ e.printStackTrace(agent.getOut()); >+ LOG.error(AgentI18NResourceKeys.AGENT_START_RETRY_AFTER_FAILURE); >+ agent.getOut().println(MSG.getMsg(AgentI18NResourceKeys.AGENT_START_RETRY_AFTER_FAILURE)); >+ try { >+ Thread.sleep(60000L); >+ } catch (InterruptedException e1) { >+ Thread.currentThread().interrupt(); >+ break; >+ } > } > } >- return; > } > > private void checkTempDir() { >-- >1.8.1.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 987628
:
777434
|
870181
| 870182