Also check presence of trigger_file on master after promotion when pg_is_in_recovery() = false and if it is there - remove it. Plus check presence of trigger_file on a new slave (after running pg_basebackup) and if it is there - also remove it.
update_leader can throw EtcdError exception unused HealthiestMemberError exception is removed