summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2018-10-08 00:04:40 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2018-10-08 19:48:51 -0400
commit7a9b195b1665661e10c7e943ce9d5dc6f3226ffc (patch)
tree941fb2000cd70386c458481416f82dd99a20a853
parent22f97156ab99272bb144fdbd43b9c33a4387451a (diff)
downloadmongo-7a9b195b1665661e10c7e943ce9d5dc6f3226ffc.tar.gz
SERVER-36626 Draw wait-for graph from left to right
-rw-r--r--buildscripts/gdb/mongo_lock.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/buildscripts/gdb/mongo_lock.py b/buildscripts/gdb/mongo_lock.py
index 7ac4e2981ba..b1a7e4c6ba3 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(