The Wrong Database Connection: A Go Deadlock Story
dev.to·4d·
Discuss: DEV
🔵Go
Preview
Report Post

TL;DR: Using the wrong connection within a limited connection pool leads to deadlock when concurrent executions exhaust all available connections.

Imagine you’re a software engineer (and you probably are, considering you’re reading this). One day you log in at work, check your workload status, your Grafana dashboard, or if you were diligent enough to create proper alerting, you get paged via PagerDuty, only to discover your application has been stuck for minutes, hours, or even days.

Not dead, just stuck in an idle state, unresponsive to any events. Or even worse, some liveness/readiness probes start failing apparently at random, causing restarts of your service and leaving you with few insights to debug. And in the case no proper alerting or monitoring is set, you won’t easil…

Similar Posts

Loading similar posts...