Race condition with bridges containing a vlan on a bond

Hi folks, I'm having an issue I could use some help with. My interface setup is several physical interfaces bonded, and then vlans on the bond, and then 1 bridge per vlan interface.

For example:

eth1 + eth2 = bond0

br0 contains bond0.10
br1 contains bond0.20
Etc.

This has worked well for me for years, but I recently got a new piece of hardware and made a new build for it, and now when it is powering on there seems to be a race condition, where if the bond is not up in time, none of the bridges come up either.

This can be reproduced by restarting the bond interface in luci, all the the bridges go down and stop working until I restart them all.

My potential solution is to use hotplug.d to write a script where if bond0 is action up, then loop through the bridges and cycle them.

Was curious if anyone else has seen this and if there is a more elegant solution. I noticed the "force link" option on the interfaces and was unsure if it could be related. I wasn't clear on what it did from the documentation.

Any input would be appreciated. Thanks!

Here is my janky solution... I set the bridges to not start on boot and put this in /etc/hotplug.d/iface/99-bond

Again any input would be welcome because I'm not really a fan of this.

BOND_DEVICE="bond-lan"
BOND_IFACE="lan"
BRIDGE_PREFIX="br-"
BRIDGES=""

if [ "${INTERFACE}" = "${BOND_IFACE}" ]; then
    i=0
    while uci get network.@device[$i] &> /dev/null; do
        if [ "$(uci get network.@device[$i].type)" = "bridge" ]; then
            if uci get network.@device[$i].ports | grep -Eq ^$BOND_DEVICE; then
                BR_IFACE=$(uci get network.@device[$i].name)
                BR_IFACE=${BR_IFACE#"$BRIDGE_PREFIX"}
                BRIDGES="$BRIDGES $BR_IFACE"
            fi
        fi
    i=$((i+1));
    done

    if [ "${ACTION}" = "ifdown" ]; then
        ifdown $BRIDGES
        for bridge in $BRIDGES; do
            ifdown $bridge
        done
    fi

    if [ "${ACTION}" = "ifup" ]; then
        for bridge in $BRIDGES; do
            ifup $bridge
        done
    fi
fi

you may wish to take a look at /lib/netifd/proto/bonding.sh specifically around the proto_bonding_add_slave() { logic