Tech Musings
Tech Musings
Mar 27, 2026 · Backend Development

Why Go’s database/sql Deadlock Needed a New closingMutex and How It Works

Go’s database/sql package can deadlock when a Scan holds a read lock, a cancelled context triggers Close, and Columns attempts another read lock, but the new closingMutex introduced in Go’s source replaces the generic sync.RWMutex to allow reads during pending writes, preventing the deadlock.

DeadlockGoTesting
0 likes · 16 min read
Why Go’s database/sql Deadlock Needed a New closingMutex and How It Works
Ops Development & AI Practice
Ops Development & AI Practice
Jun 1, 2024 · Databases

How Go’s database/sql Injects MySQL Drivers: A Deep Dive

This article explains how Go’s standard database/sql package uses a driver registration mechanism to integrate third‑party MySQL drivers, detailing the global driver map, registration function, init process, and a complete example showing how to define, register, and use a custom MySQL driver.

GoMySQL driverdatabase/sql
0 likes · 7 min read
How Go’s database/sql Injects MySQL Drivers: A Deep Dive
Alibaba Cloud Native
Alibaba Cloud Native
Mar 24, 2021 · Backend Development

Building a Go MySQL Driver for Seata AT Mode: A Practical Guide

This article details the development of a Go MySQL driver that fully supports Seata's AT distributed‑transaction mode, covering background, design decisions, driver specifics, initialization steps, code examples, and how it lowers the barrier for Go microservices to use distributed transactions.

Microservicesdatabase/sqldistributed-transactions
0 likes · 6 min read
Building a Go MySQL Driver for Seata AT Mode: A Practical Guide