When you have an activity that can be usefully performed on many
servers, you can use the broadcast feature to repeat the same step on many
servers.
Normally, a step runs on only one server. However, each step has a
Broadcast check
box. When a step's
Broadcast box is checked, at run
time the system replaces the step with a set of non-broadcast steps, one for
each server that matches the step's selector.
Note: If the selector for
the step matches only one server, then the step runs only once.
Potential uses for broadcasting include:
- Rebooting a group of servers.
- Running a test on a group of servers.
- Copying the same set of files to a whole group of servers.
- Checking out the same set of source code to multiple servers, preparing
them for later individual tasks with a single, easy-to-maintain step.
Threading in Broadcast Steps
When it creates replacement
steps for a broadcast step at run time, the system threads steps as follows:
- If the broadcast step's Thread property is set
to No , the replacement steps get the same Thread value,
and thus all execute in series. Each step must complete before the next one
can start.
- If the broadcast step's Thread property is set
to Yes, the replacement steps also get the same Thread values.
This results in a set of steps which execute in parallel with each other and
with any threaded steps which precede or follow the broadcast step.
- If the broadcast step's Thread property is set
to Join, the system creates the replacement steps with Thread set
to Yes, except the last step, which is marked Join.
The result is a set of steps which execute in parallel with each other, and
with any threaded steps which precede them, but the whole set must complete
before the step following the broadcast step can start.
Launching Other Projects From a Broadcast Step
You
can broadcast a step that includes an inline project or which chains a project
on the step's passage or failure (Pass Chain/Fail
Chain). When you broadcast a step that launches (chains) another
project, be aware that the broadcast step does not override the
launched project's selector. In general, use a library project (one that has
no selector of its own) when launching a project from a broadcast step, if
your intent is to launch the project on every server matching the broadcast
step's selector.
If you do not use a library project, each copy of the
broadcast step runs on a different server, but the inlined or chained project
obeys its own selector, which may not choose the same server as the copy of
the broadcast step. You can end up with each broadcast step running on a different
server, while all of the steps from an inlined project run on the same server,
multiple times.
Note: If your intent is to use Broadcast to
launch a library once on each server that matches a selector, be sure to also
set the Sticky option on the library, so that all of
its steps (that use the default project server) run on the same server.