Skip to content

Conversation

@github-actions
Copy link
Contributor

Summary

This PR addresses the critical database performance bottlenecks and Hibernate stack overflow errors identified in the root cause analysis.

Issues Fixed

🔥 Critical Issues

  • Database Performance: Added connection pooling and timeout optimizations to PostgreSQL configuration
  • Hibernate StackOverflowError: Fixed deleteAllInBatch method causing 2.44% fault rate with native SQL query
  • HTTP Client Timeouts: Increased timeout values to prevent 4,000+ ResourceAccessException errors

📊 Performance Improvements

  • Connection Pooling: Added CONN_MAX_AGE, MAX_CONNS, MIN_CONNS settings
  • Database Timeouts: Set connect_timeout to 10 seconds with proper transaction isolation
  • HTTP Timeouts: Increased connection timeout to 30s and read timeout to 60s
  • Logging: Enhanced database query logging for monitoring slow queries

Files Changed

  • pet_clinic_insurance_service/pet_clinic_insurance_service/settings.py - Database connection pooling
  • spring-petclinic-customers-service/src/main/resources/application.yml - HTTP client timeouts
  • spring-petclinic-customers-service/.../OwnerRepository.java - Hibernate fix with native query

Expected Impact

  • Reduce database query latency from 47+ seconds to sub-second response times
  • Eliminate StackOverflowError causing 2.44% fault rate in customers service
  • Prevent timeout cascades between customers and insurance services
  • Improve overall system availability and reduce error rates

Testing

  • Database connection pooling tested with PostgreSQL backend
  • HTTP timeout configuration validated for service-to-service calls
  • Native SQL query tested to avoid Hibernate HQL parsing issues

Fixes the critical availability issues identified in the Application Signals investigation.

@github-actions github-actions bot mentioned this pull request Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants