Add support for concurrency grace period
Describe the current behavior
Prefect Cloud recently added a concurrency grace period field on the edit deployment page to configure the initial lease duration for a flow run when it's "Pending" but has not had its infra spun up and transitioned to "Running" yet. This is useful when you anticipate that your infrastructure will take a lengthy amount of time to start the flow run (e.g, more than the previous 5/10 minute defaults, which caused crashes in some cases where the run would then start, but try to grab the concurrency lease and fail to since it had already expired).
Describe the proposed behavior
Add support for this to the OSS server and client, allowing users to configure the grace period on self-hosted Prefect Servers and set it client-side when using Prefect Cloud.
Example Use
sample usage in a prefect.yaml file:
deployments:
- name: business_critical_deployment
entrypoint: business_critical_deployment.py:business_critical_flow
work_pool:
name: process-workpool
concurrency_limit:
collision_strategy: "ENQUEUE"
limit: 1
grace_period_seconds: 600
Additional context
Current usage today