Unveiling and Vanquishing Goroutine Leaks in Enterprise Microservices: A Dynamic Analysis Approach
Go is a modern programming language gaining popularity in enterprise microservice systems. Concurrency is a first-class citizen in Go with lightweight “goroutines” as the building blocks of concurrent execution. Go advocates message-passing to communicate and synchronize among goroutines. Improper use of message passing in Go can result in “partial deadlock” (interchangeably called a goroutine leak), a subtle concurrency bug where a blocked sender (receiver) never finds a corresponding receiver (sender), causing the blocked goroutine to leak memory, via its call stack and objects reachable from the stack.
In this paper, we systematically study the prevalence of message passing and the resulting partial deadlocks in ≈75 Million lines of Uber’s Go monorepo hosting ≈2500 microservices. We develop two lightweight, dynamic analysis tools: GOLEAK and LEAKPROF, designed to identify partial deadlocks. GOLEAK detects partial deadlocks during unit testing and prevents the introduction of new bugs. Conversely, LEAKPROF uses goroutine profiles obtained from services deployed in production to pinpoint intricate bugs arising from complex control flow, unexplored interleavings, or the absence of test coverage. We share our experience and insights deploying these tools in developer workflows in a large industrial setting. Using GOLEAK we unearthed 857 pre-existing goroutine leaks in the legacy code and prevented the introduction of ≈260 new leaks over one year period. Using LEAKPROF we found 24 and fixed 21 goroutine leaks, which resulted in up to 34% speedup and 9.2× memory reduction in some of our production services.
Wed 6 MarDisplayed time zone: London change
10:00 - 11:00 | |||
10:00 20mTalk | EasyView: Bringing Performance Profiles into Integrated Development Environments Main Conference Qidong Zhao North Carolina State University, Milind Chabbi Scalable Machines Research, Xu Liu North Carolina State University Pre-print | ||
10:20 20mTalk | Experiences Building an MLIR-Based SYCL Compiler Main Conference Ettore Tiotto Intel Corporation, Victor Perez Codeplay Software, Whitney Tsang Intel Corporation, Lukas Sommer Codeplay Software, Julian Oppermann Codeplay Software, Victor Lomüller Codeplay Software, Mehdi Goli Codeplay Software, James Brodman Intel Corporation Pre-print | ||
10:40 20mTalk | Unveiling and Vanquishing Goroutine Leaks in Enterprise Microservices: A Dynamic Analysis Approach Main Conference Georgian-Vlad Saioc Aarhus University; Uber Technologies, Dmitriy Shirchenko Uber Technologies, Milind Chabbi Uber Technologies Pre-print Media Attached |