CentaurusInfra / mizar

Mizar – Experimental, High Scale and High Performance Cloud Network https://mizar.readthedocs.io
https://mizar.readthedocs.io
GNU General Public License v2.0
112 stars 50 forks source link

Use while to let ConsumeInterfaces waiting for ProduceInterfaces #623

Closed Hong-Chang closed 2 years ago

Hong-Chang commented 2 years ago

When starting a pod, currently it may need 15 seconds to be in running state. After this pr, for a single pod, it reduces to 2 seconds to be in running state.

The reason behind: ConsumeInterface and ProduceInterface are from two different process. ConsumeInterface depends on ProduceInterface. If ConsumeInterface runs first, the process will fail and will be retried after 15 seconds, that's the reason we see the pod is running after 15 seconds. This pr is to add a wait for ConsumeInterface until ProduceInterface has done. Although the code sets a timeout of 5 seconds, I see a single pod will be running in 2 seconds.