From daaf0aae8b713a3eafde8ebf20ae620f272e3388 Mon Sep 17 00:00:00 2001 From: Siyuan Zhou Date: Mon, 8 Oct 2018 00:04:40 -0400 Subject: SERVER-36626 Draw wait-for graph from left to right (cherry picked from commit 7a9b195b1665661e10c7e943ce9d5dc6f3226ffc) --- buildscripts/gdb/mongo_lock.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buildscripts/gdb/mongo_lock.py b/buildscripts/gdb/mongo_lock.py index e886855b2eb..a7cef33a83e 100644 --- a/buildscripts/gdb/mongo_lock.py +++ b/buildscripts/gdb/mongo_lock.py @@ -185,6 +185,10 @@ class Graph(object): if message is not None: sb.append(message) sb.append('digraph "mongod+lock-status" {') + # Draw the graph from left to right. There can be hundreds of threads blocked by the same + # resource, but only a few resources involved in a deadlock, so we prefer a long graph + # than a super wide one. Long resource / thread names would make a wide graph even wider. + sb.append(' rankdir=LR;') for node_key in self.nodes: for next_node_key in self.nodes[node_key]['next_nodes']: sb.append(' "{}" -> "{}";'.format( -- cgit v1.2.1