When running a flow in Prefect 2.x on Kubernetes, if the Prefect server goes down and comes back online after a few seconds, the behavior generally depends on how Prefect is set up and how long the server downtime lasts.
Typically, Prefect has been designed with resiliency in mind for such situations:
1.
Short Downtime: For brief interruptions, like a few seconds, your flow runs may not be noticeably affected, especially if they are executing in Kubernetes pods. Kubernetes often manages the lifecycle of its pods independently of the Prefect server. The server handles orchestration, metadata storage, and scheduling, while the execution can continue uninterrupted in Kubernetes.
2.
Flow Continuation: Prefect agents, which are responsible for kicking off flow runs, will continue to operate even if the server is temporarily unavailable. Once the server is back online, it can resume operation and pick up where it left off.
3.
Resiliency and QoS of Agents: If the Prefect agent is running locally on Kubernetes, it can automatically reconcile the current state and update the server with the run status once connectivity is restored.
Therefore, if the downtime is brief and non-disruptive to the running pods, the flows should continue running as expected, with any needed updates relayed once connectivity is re-established. For more detailed information, you can refer to the Prefect Kubernetes guide:
Running Flows with Kubernetes.
It seems there were no specific issues reported in the Prefect GitHub repository regarding server downtime affecting Kubernetes flows. So, it appears to be a generally stable setup for handling short-term server interruptions.