rhq-project/rhq — pull request #6 by jshaughn (2014-03-05 18:51:11+00:00)
Title: [918207] Uninventorying resources for agents, on unreachable networks or...

... waiting for registration, causes database hang

** Folks, Looking for review of the approach and the impl. Also wondering if perhaps there should be some
** sort of implicit call to pingService for every agentClient call, although I don't think so. Main commit
** comment follows below...

There are two underlying issues in this BZ. First, agent notifications
for uninventory are not protected via a short ping check. And second, our
current AgentClient.ping() returns true if a comm link can be established,
even if the agent is not accepting service requests. Since by default we
don't timeout service requests, service requests can wait indefinitely for
an agent that is failing to connect.

This commit adds a new AgentClient.servicePing(long) which returns true
only if the agent can be reached, is accepting service requests, and returns
before the supplied timeout expires. It also adds a call to this in the
uninventory SLSB, as well as converts existing ping() calls to pingService().