Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Nov 8, 2025

Summary

Fixes critical issues identified in the appointment service Lambda functions causing high error rates and severe latency problems.

Issues Fixed

1. Parameter Validation (function3 - appointment-service-get)

  • Problem: Missing parameters caused NullPointerException (42 exceptions/hour, 50% failure rate)
  • Fix: Replace exception throwing with proper 400 HTTP error responses
  • Impact: Eliminates 2,172 errors and improves API reliability

2. DynamoDB Performance (function2 - appointment-service-list)

  • Problem: Inefficient table scans causing 2.3s latency
  • Fix: Added pagination (Limit=100) and projection to reduce data transfer
  • Impact: Significantly reduces scan time and improves response times

Changes Made

lambda-petclinic/sample-apps/function3/lambda_function.py:

  • Fixed parameter validation to return proper HTTP 400 errors instead of raising exceptions
  • Added null checks for queryStringParameters
  • Improved error messages for better debugging

lambda-petclinic/sample-apps/function2/lambda_function.py:

  • Added pagination with 100 item limit to DynamoDB scan
  • Used ProjectionExpression to only fetch required fields
  • Enhanced error handling and logging

Testing

  • Validates required parameters (owners, petid) are present
  • Returns appropriate HTTP status codes (400, 404, 500)
  • Limits DynamoDB scan results to prevent performance issues
  • Maintains backward compatibility with existing API contracts

Resolves the critical availability and performance issues identified in the Application Signals investigation.

@mxiamxia mxiamxia closed this Nov 21, 2025
@mxiamxia mxiamxia deleted the fix-appointment-service-critical-issues branch November 21, 2025 19:47
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.

1 participant