diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2019-05-27 11:43:26 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2019-05-30 15:54:33 +0000 |
commit | 14d9c6179715205fb6ac816d4621dd087f5afbb2 (patch) | |
tree | d8f94f2d0461c975d57c53860508b012c870742d /libglusterfs/src | |
parent | d2576452028db3b817fc5b1f4f924a98bc22c7dc (diff) |
stack: Make sure to have unique call-stacks in all cases
At the moment new stack doesn't populate frame->root->unique in all cases. This
makes it difficult to debug hung frames by examining successive state dumps.
Fuse and server xlators populate it whenever they can, but other xlators won't
be able to assign 'unique' when they need to create a new frame/stack because
they don't know what 'unique' fuse/server xlators already used. What we need is
for unique to be correct. If a stack with same unique is present in successive
statedumps, that means the same operation is still in progress. This makes
'finding hung frames' part of debugging hung frames easier.
fixes bz#1714098
Change-Id: I3e9a8f6b4111e260106c48a2ac3a41ef29361b9e
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r-- | libglusterfs/src/stack.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libglusterfs/src/stack.c b/libglusterfs/src/stack.c index 82b35772d6e..371f60c4436 100644 --- a/libglusterfs/src/stack.c +++ b/libglusterfs/src/stack.c @@ -17,6 +17,7 @@ create_frame(xlator_t *xl, call_pool_t *pool) { call_stack_t *stack = NULL; call_frame_t *frame = NULL; + static uint64_t unique = 0; if (!xl || !pool) { return NULL; @@ -52,6 +53,7 @@ create_frame(xlator_t *xl, call_pool_t *pool) { list_add(&stack->all_frames, &pool->all_frames); pool->cnt++; + stack->unique = unique++; } UNLOCK(&pool->lock); GF_ATOMIC_INC(pool->total_count); |