c97253eff5
There was at least one error, likely a race condition, with the previous code which could cause more than one ExecutorWorkerThread for a node to be spawned. In particular, I think the bogus comparison in ComputerListenerImpl may have a large part in that (it checked to see if a _Computer_ object was in a list of _Thread_ objects). To improve reliability around adding and removing nodes, all related functionality is moved to the GearmanProxy class. Any methods (most of them) that have to do with starting or stopping worker threads are synchronized on the GearmanProxy monitor (the important parts of most threads were already synchronized on the worker list before, so this should not be much of a performance change). The methods that start management and executor threads now do their own checking to verify that such threads do not already exist, making it so that calling them is more idempotent. Existing checks external to the class have been removed (these were likely somewhat racy). To avoid keeping redundant data structures, the node availability list is removed, and instead if we need to find an availability object, we walk the list of worker threads and compare to their nodes. Because we do this so much, the list of worker and management threads are changed to use those explicit classes instead of AbstractWorkerThreads. The accessor methods for the internal lists of worker threads is removed to ensure that they are only managed through GearmanProxy. This changed some unit tests and required the removal of one complete test (which was not doing much more than verifying the addition operator). Also, when stopping ExecutorWorkerThreads, stop all of the ones associated with a node. When a computer goes offline, Computer.getNode() returns null, so we can't know which workers should be deleted. Instead of using Nodes as keys for our workers, use Computers instead and change everything to use Computer (most functions needed Computer rather than Node anyway), and in the few remaining places where a Node is needed, convert the other direction. Change-Id: Ia5084579317f972400069cc3e84db4e0b6560a80 |
||
---|---|---|
.settings | ||
src | ||
.classpath | ||
.gitignore | ||
.gitreview | ||
.project | ||
.pydevproject | ||
LICENSE | ||
README.rst | ||
bsd.txt | ||
debug | ||
install-fast | ||
pom.xml | ||
run-fast |
README.rst
Overview
This plugin uses Gearman to support multiple Jenkins masters. More info can be found at https://wiki.jenkins-ci.org/display/JENKINS/Gearman+Plugin
Contributing
If you would like to contribute to the development of OpenStack, you must follow the steps in the "If you're a developer, start here" section of this page:
Once those steps have been completed, changes to OpenStack should be submitted for review via the Gerrit tool, following the workflow documented at:
Pull requests submitted through GitHub will be ignored.
Project site:
Patches are submitted via Gerrit at:
Bugs should be filed on Launchpad, not GitHub:
Cloning:
License
Copyright 2013 Hewlett-Packard Development Company, L.P.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.