--- # Test Gitea After Connection Pool Fix - name: Test Gitea After Connection Pool Fix hosts: production gather_facts: no become: no vars: gitea_stack_path: "{{ stacks_base_path }}/gitea" gitea_url: "https://{{ gitea_domain }}" tasks: - name: Test Gitea health endpoint ansible.builtin.uri: url: "{{ gitea_url }}/api/healthz" method: GET validate_certs: false timeout: 35 register: gitea_test changed_when: false - name: Check Gitea logs for connection pool messages ansible.builtin.shell: | cd {{ gitea_stack_path }} docker compose logs gitea --tail 100 | grep -iE "timeout.*authentication|connection.*pool|MAX_OPEN_CONNS|database.*pool" | tail -20 || echo "No connection pool messages found" register: gitea_logs_check changed_when: false failed_when: false - name: Check Postgres logs for authentication timeouts ansible.builtin.shell: | cd {{ gitea_stack_path }} docker compose logs postgres --tail 50 | grep -iE "timeout.*authentication|authentication.*timeout" | tail -10 || echo "No authentication timeout messages found" register: postgres_logs_check changed_when: false failed_when: false - name: Display test results ansible.builtin.debug: msg: | ================================================================================ GITEA CONNECTION POOL FIX - TEST RESULTS ================================================================================ Health Check Result: - Status: {{ gitea_test.status | default('TIMEOUT') }} - Response Time: {{ gitea_test.elapsed | default('N/A') }}s {% if gitea_test.status | default(0) == 200 %} ✅ Gitea is reachable {% else %} ❌ Gitea returned status {{ gitea_test.status | default('TIMEOUT') }} {% endif %} Gitea Logs (Connection Pool): {{ gitea_logs_check.stdout }} Postgres Logs (Authentication Timeouts): {{ postgres_logs_check.stdout }} ================================================================================ INTERPRETATION: ================================================================================ {% if 'timeout.*authentication' in gitea_logs_check.stdout | lower or 'timeout.*authentication' in postgres_logs_check.stdout | lower %} ⚠️ Authentication timeout messages still present → Connection pool settings may need further tuning → Consider increasing MAX_OPEN_CONNS or authentication_timeout {% else %} ✅ No authentication timeout messages found → Connection pool fix appears to be working {% endif %} ================================================================================