How to set timeout when fetching jars in artifact-fetcher for Ververica Platform

Question

Sometimes, fetching artifacts from our artifact store is slow. How can I set the timeout for fetching jars using artifact-fetcher in Ververica Platform?

Answer

Note: This section applies to Flink 1.13 + with Ververica Platform 2.9.1 +.

If your Flink jobs fetch application JARs directly from a remote repository, sometimes the remote server could be slow to serve the JAR, and the request can time out. In extreme cases, each retry also times out, and the job fails to start. To prevent this, we can manually configure the timeout for fetching the JARs to fix this issue.

This can be achieved by setting environment variables and overriding the default timeouts to considerably larger values. This will allow the application to wait longer to download the Jars from the remote repository and prevent the Flink application from failing too quickly.

env:
  - name: VVP_APPMANAGER_ARTIFACT-FETCHER_GENERAL_CONNECT-TIMEOUT
    value: "100"
  - name: VVP_APPMANAGER_ARTIFACT-FETCHER_GENERAL_READ-TIMEOUT
    value: "1000"

The unit of these values is seconds. If you want to increase the timeouts, the numbers in the value of the environment variable should be larger than the default value.

Following are the default values of these variables without passing the environment variables.

Environment Variable Description Default Value
VVP_APPMANAGER_ARTIFACT-FETCHER_GENERAL_CONNECT-TIMEOUT Connection timeout 10 seconds
VVP_APPMANAGER_ARTIFACT-FETCHER_GENERAL_READ-TIMEOUT Read timeout 600 seconds