Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from Neon to Aurora #41

Closed
kislerdm opened this issue Feb 19, 2023 · 1 comment
Closed

Migrate from Neon to Aurora #41

kislerdm opened this issue Feb 19, 2023 · 1 comment
Labels
infrastructure Deployment and infra including CI and automation
Milestone

Comments

@kislerdm
Copy link
Owner

Problem

@deim and I discovered that Neon connection goes down for unknown reasons during pairing session.

Proposed Solution

Migrate to AWS RDS Aurora

@kislerdm kislerdm added the infrastructure Deployment and infra including CI and automation label Feb 19, 2023
@kislerdm kislerdm added this to the v0.0.2 milestone Feb 19, 2023
@kislerdm
Copy link
Owner Author

The issue was related to wrong db connection management.

Was

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 */
}

Is

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) }()
}

@kislerdm kislerdm closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Deployment and infra including CI and automation
Projects
Status: Done
Development

No branches or pull requests

1 participant