When a node comes up, there is a chance that it will not yet have devices when DefaultTopologyProvider is started and builds the new initial topology. I often see no devices, but the correct links. When it is building the topo, since it has no devices, it ignores the links, leading to an empty topology. This seems very common and happens almost everytime I restart a node. However, sometimes the DefaultTopologyProvider does not see any DEVICE_ADDED events when the devices are discovered and only sees DEVICE_UPGRADED events. These events are ignored by the listener, and does not trigger a recompute of the topology. Thus, unless a device/link changes or a manual retrigger of the topology builder happens, that node will have an empty topology.
A workaround fix could be to add DEVICE_UPGRADED events to the listener, but a more ideal solution would be to figure out why the DefaultTopologyProvider does not see the DEVICE_ADDED events.