pawalat opened a new pull request, #30628: URL: https://github.com/apache/airflow/pull/30628
This pull request introduces a retry mechanism to handle Vault connection failures more gracefully. By employing the urllib3.util.Retry class, we can configure the retry behavior for specific HTTP status codes that are more likely to be transient, such as 412 (Precondition Failed), 500 (Internal Server Error), 502 (Bad Gateway), and 503 (Service Unavailable). These changes are implemented within the Vault client file, using the hvac library, to enhance the robustness and reliability of the connection with Vault. The hvac library's Client class allows for the injection of a custom Session object, which we can configure with an HTTPAdapter instance to apply our desired retry behavior. As mentioned in the [hvac documentation](https://hvac.readthedocs.io/en/stable/advanced_usage.html#retrying-failed-requests), thoughtful retrying of failed requests is crucial for a seamless experience with Vault, especially in the context of eventual consistency. Vault may return a 412 status code when data is not yet available on the node where the request was made. In addition, retrying 5xx status codes is generally advisable. With these changes, Airflow's integration with Vault becomes more resilient and fault-tolerant, improving the overall user experience and stability of the system. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
