If a hub doesn't have a trade link to an autofac or extractor supplying any given resource (for example, if the last supplying planet is captured), it can't continue to export the resource even if it has a large stockpile remaining. Likewise, no planet will use a resource it can't produce or get even if it has a stockpile. This is pretty disruptive; planets should continue to use resources until they're depleted but display a warning when they're using a resource that can't be replenished through trade or a production structure.
Trade hubs and resource-using planets should try to build up larger stockpiles than they currently do, rather than leaving all surplus resources on the planet that's producing the resource. Right now empires can be crippled in minutes by cutting off trillum planets; if surplus trillum got stockpiled on highly defensible hubs and planets with high trillum demand (like CG autofacs) by default, it would give the attacked player more time to respond.
Even if the stockpiling on import planets isn't set by default there should be an option to allow it. One way is to allow setting of specific transfer amounts in addition to the percentages currently used.