Closed kislerdm closed 1 year ago
The issue was related to wrong db connection management.
func handler(
clientModel core.ClientInputToGraph, clientDiagram core.ClientGraphToDiagram, corsHeaders corsHeaders,
clientStorage core.ClientStorage,
) func(
ctx context.Context, req events.APIGatewayProxyRequest,
) (events.APIGatewayProxyResponse, error) {
return func(
ctx context.Context, req events.APIGatewayProxyRequest,
) (events.APIGatewayProxyResponse, error) {
// connection closed after the first invocation
defer func() { _ = clientStorage.Close(ctx) }()
/* rest of the code */
}
func main() {
/* rest of the code */
// connection is closed on lambda container termination
ctx, cancelFn := context.WithTimeout(context.Background(), time.Second*10)
defer cancelFn()
defer func() { _ = clientStorage.Close(ctx) }()
}
Problem
@deim and I discovered that Neon connection goes down for unknown reasons during pairing session.
Proposed Solution
Migrate to AWS RDS Aurora