Database Deadlock Diagnosis for Large-Scale ORM-Based Web Applications
Zhiyuan Dong, Zhaoguo Wang, Chuanwei Yi, Xian Xu, Jinyuan Zhang, Jinyang Li, Haibo Chen
Abstract
Today, most database-backed web applications depend on the database to handle deadlocks. At runtime, the database monitors the progress of transaction execution to detect deadlocks and abort affected transactions. However, this common detect-and-recover strategy is costly to performance as aborted transactions waste CPU resources.
To avoid deadlock-induced performance degradation, developers aim to reorganize the application code to remove deadlocks. Unfortunately, doing so is difficult for web applications. Not only do their implementations include hundreds of thousands of LoCs, but they also use third-party object-relational mapping (ORM) frameworks which hide database access details. Consequently, it is hard for developers to accurately diagnose deadlocks.
We propose WeSEER, a deadlock diagnosis tool for web applications. To overcome the opacity of ORMs, WeSEER performs concolic execution on unit tests to extract a web application's transactions as a sequence of template statements with symbolic inputs as well as path conditions that enable the sequence. WeSEER then analyzes the extracted transactions based on finegrained lock modeling to identify potential deadlocks and report the code locations that cause them. We implement WeSEER for Java-based (OpenJDK) web applications, and use it to analyze two popular open-source e-commerce applications, Broadleaf and Shopizer. WeSEER has successfully identified 18 potential deadlocks in Broadleaf and Shopizer. Eliminating these identified deadlocks can result in up to 39.5× and 4.5× throughput improvement for Broadleaf and Shopizer, respectively.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Builds on3
- Polyjuice: High-Performance Transactions via Learned Concurrency ControlJia-Chen Wang, Ding Ding, Huan Wang, Conrad Christensen et al.OSDI 2021 · 39 citations
- WeTune: Automatic Discovery and Verification of Query Rewrite RulesZhaoguo Wang, Zhou Zhou, Yicun Yang, Haoran Ding et al.SIGMOD 2022 · 35 citations
- Ad Hoc Transactions in Web Applications: The Good, the Bad, and the UglyChuzhe Tang, Zhaoguo Wang, Xiaodong Zhang, Qianmian Yu et al.SIGMOD 2022 · 20 citations
Related papers
- A Compositional Deadlock Detector for Android JavaJames Brotherston, Paul Brunet, Nikos Gorogiannis, Max I. KanovichASE 2021 · 8 citations
- DLOS: Effective Static Detection of Deadlocks in OS KernelsJia-Ju Bai, Tuo Li, Shi-Min HuUSENIX ATC 2022 · 10 citations
- HAWK: A Workload-driven Hierarchical Deadlock Detection Approach in Distributed Database SystemRongrong Zhang, Zhiwei Ye, Jun-Peng Zhu, Peng Cai et al.VLDB 2025 · 1 citation
- LCL: A Lock Chain Length-based Distributed Algorithm for Deadlock Detection and ResolutionZhenkun Yang, Chen Qian, Xuwang Teng, Fanyu Kong et al.ICDE 2023 · 8 citations
- Generating Test Databases for Database-Backed ApplicationsCong Yan, Suman Nath, Shan LuICSE 2023 · 4 citations
