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
nonbroadcast 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 run 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 that run in parallel with each other and with any threaded
steps that 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 that run in parallel with each other, and with any
threaded steps that 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 that 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 (a project
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,
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.