RETIRED, The jenkins gearman plugin
Go to file
James E. Blair c97253eff5 Rework starting/stopping executors
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
2013-08-13 11:31:50 -07:00
.settings update eclipse setting 2013-01-29 12:05:01 -08:00
src Rework starting/stopping executors 2013-08-13 11:31:50 -07:00
.classpath add new unit tests for plugin 2013-03-20 21:11:27 -07:00
.gitignore Fix to register all projects and register an additional gearman function for each project. 2013-02-22 10:29:00 -08:00
.gitreview Added .gitreview 2013-01-10 23:49:17 +00:00
.project abort running jenkins builds 2013-02-21 10:17:54 -08:00
.pydevproject abort running jenkins builds 2013-02-21 10:17:54 -08:00
LICENSE add pom.xml and gearman-plugin source file. 2013-01-29 10:09:47 -08:00
README.rst update docs 2013-03-27 14:53:13 -07:00
bsd.txt setup gearman workers 2013-02-06 10:21:20 -08:00
debug Gearman configuration UI is setup in the jenkins config page 2013-01-29 12:05:01 -08:00
install-fast setup skeleton GearmanPlugin. 2013-01-29 12:04:42 -08:00
pom.xml setup version as a parameter 2013-06-19 14:32:49 -07:00
run-fast Add local GearmanWorker. 2013-04-22 10:29:03 -07:00

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:

http://wiki.openstack.org/HowToContribute

Once those steps have been completed, changes to OpenStack should be submitted for review via the Gerrit tool, following the workflow documented at:

http://wiki.openstack.org/GerritWorkflow

Pull requests submitted through GitHub will be ignored.

Project site:

Patches are submitted via Gerrit at:

Bugs should be filed on Launchpad, not GitHub:

https://bugs.launchpad.net/gearman-plugin

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

http://www.apache.org/licenses/LICENSE-2.0

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.