postgresql_cluster icon indicating copy to clipboard operation
postgresql_cluster copied to clipboard

Implement retry logic in Docker workflow to handle network failures

Open ThomasSanson opened this issue 2 years ago • 0 comments

Hello,

We have been experiencing occasional failures in our Docker GitHub Actions workflow due to network issues. These failures usually occur in the "Run Docker tests" steps of the workflow.

To mitigate this, I would like to implement a retry mechanism in our workflow. The idea is to retry these steps a few times (let's say 3 times) before marking the workflow as failed. This should help us handle transient network issues.

Considering using the nick-invision/retry@v2 action for this, which would modify our workflow file to look like this:

name: "Docker"

on:  
  push:  
    branches:  
    - master  
  pull_request:  
    branches:  
    - master  

jobs:  
  build:  
    runs-on: ubuntu-latest  
    steps:  
    - name: Set TERM environment variable  
      run: echo "TERM=xterm" >> $GITHUB_ENV  

    - name: Checkout  
      uses: actions/checkout@v3  

    - name: Set up Python 3.10  
      uses: actions/setup-python@v4  
      with:  
        python-version: "3.10"  

    - name: Install dependencies  
       run: make bootstrap-dev  

    - name: Run Docker tests  
      uses: nick-invision/retry@v2
      with:
        max_attempts: 3
        timeout_minutes: 10
        command: make docker-tests

https://github.com/vitabaks/postgresql_cluster/actions/runs/5224946567/jobs/9433782895?pr=373#step:6:999

ThomasSanson avatar Jun 09 '23 18:06 ThomasSanson