一句话:提出并实现首个形式化、可证明正确且完备的分布式黑盒死锁检测监视器,适用于 Erlang/OTP RPC 应用。
并发分布式微服务常通过消息传递和 RPC 交互,一旦部分服务死锁,依赖它们的服务会阻塞,死锁核心被掩盖,诊断困难。本文提出部署在各服务旁的黑盒监视器,仅观察出入消息并与其他监视器交换探测信息来检测死锁。作者建立了可刻画 Erlang/OTP gen_server 等 RPC 应用风格的形式模型,给出分布式黑盒监控算法,并证明其可靠且完备:既无假阳性也无假阴性。结果在 Coq 中机器化验证,并实现为 Erlang/OTP 工具 DDMon,评估其性能。这是首个对分布式黑盒死锁检测进行形式化、正确性证明并实现的工具。
Many software applications rely on concurrent and distributed (micro)services that interact via message passing and various forms of remote procedure calls (RPC). As these systems organically evolve and grow in scale and complexity, the risk of introducing deadlocks increases and their impact may worsen: even if only a few services deadlock, many other services may block while awaiting responses from the deadlocked ones. As a result, the “core” of the deadlock can be obfuscated by its consequences on the rest of the system, and diagnosing and fixing the problem can be challenging. In this work we tackle the challenge by proposing distributed black-box monitors that are deployed alongside each service and detect deadlocks by only observing the incoming and outgoing messages, and exchanging probes with other monitors. We present a formal model that captures popular RPC-based application styles (e.g., gen_servers in Erlang/OTP), and a distributed black-box monitoring algorithm that we prove sound and complete (i.e., identifies deadlocked services with neither false positives nor false negatives). We implement our results in a tool called DDMon for the monitoring of Erlang/OTP applications, and we evaluate its performance. This is the first work that formalises, proves the correctness, and implements distributed black-box monitors for deadlock detection. Our results are mechanised in Coq. DDMon is the companion artifact of this paper.
@article{paperbot2939,
title = {Correct Black-Box Monitors for Distributed Deadlock Detection: Formalisation and Implementation},
author = {Radosław Jan Rowicki and Adrian Francalanza and Alceste Scalas},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {OOPSLA2},
year = {2025},
doi = {10.1145/3763069}
}