The priority of a source is the sum of the service priority and tuner priority (or network priority for IPTV). Both have a range -10 to +10 and higher is better.
When a recording begins, Tvheadend selects the source with the highest priority and tunes to it. If Tvheadend gets absolutely no data back from the source it should switch to the next-highest priority one and so on.
Once a recording (or stream?) has started there is no failover if the source stops working.