[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-17 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Status: Patch Available  (was: Reopened)

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, 
 ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, ZOOKEEPER-591_1.patch, 
 ZOOKEEPER-591_1.patch, ZOOKEEPER-591_1.patch, ZOOKEEPER-591_2.patch, zootest.c


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-16 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Status: Patch Available  (was: Open)

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, 
 ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, ZOOKEEPER-591_1.patch, zootest.c


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-16 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Status: Open  (was: Patch Available)

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, 
 ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, ZOOKEEPER-591_1.patch, zootest.c


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-16 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Resolution: Fixed
Status: Resolved  (was: Patch Available)

I just ran ant test and it passed. I committed this!

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, 
 ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, ZOOKEEPER-591_1.patch, 
 ZOOKEEPER-591_1.patch, ZOOKEEPER-591_1.patch, zootest.c


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-11 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Attachment: zootest.c

a test case that qian actually reported that can reproduce the bug.

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, zootest.c


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-11 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Status: Patch Available  (was: Open)

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, 
 ZOOKEEPER-591.patch, zootest.c


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-11 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Status: Open  (was: Patch Available)

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, 
 ZOOKEEPER-591.patch, zootest.c


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-11 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Attachment: ZOOKEEPER-591.patch

another patch for fixing this.

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, 
 ZOOKEEPER-591.patch, zootest.c


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-11 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Status: Patch Available  (was: Open)

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, 
 ZOOKEEPER-591.patch, zootest.c


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-11 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Status: Patch Available  (was: Open)

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, 
 ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, zootest.c


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-11 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Status: Open  (was: Patch Available)

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, 
 ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, zootest.c


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-11 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Attachment: ZOOKEEPER-591.patch

this patch fixes the issue. I have added a test case as well which is on teh 
lines of the code posted by Qian. 

Qian, you can go ahead and try it. This should fix the bug.

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, 
 ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, zootest.c


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-11 Thread Benjamin Reed (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Reed updated ZOOKEEPER-591:


Hadoop Flags: [Reviewed]

+1 good job mahadev!

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, 
 ZOOKEEPER-591.patch, ZOOKEEPER-591.patch, zootest.c


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-10 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Priority: Blocker  (was: Critical)

we need to resolve this. marking it as a blocker.

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-10 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Status: Open  (was: Patch Available)

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-10 Thread Patrick Hunt (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Patrick Hunt updated ZOOKEEPER-591:
---

Status: Open  (was: Patch Available)

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Blocker
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch, ZOOKEEPER-591.patch


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-09 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Status: Patch Available  (was: Open)

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Critical
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-03-09 Thread Mahadev konar (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mahadev konar updated ZOOKEEPER-591:


Attachment: ZOOKEEPER-591.patch

looking at the code, it looks like that there is a race condition wherein after 
free_completions is called by do_io(), calls could still be queued, which will 
cause the above problem to happen. I am attachign a patch which will not allow 
calls to be queued as soon as zookeeper_close() is callled.

Qian, can you try out this patch and post the results. Its not possible to 
write a unit test for this.

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Assignee: Mahadev konar
Priority: Critical
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-591.patch


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-591) The C Client cannot exit properly in some situation

2010-01-19 Thread Patrick Hunt (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Patrick Hunt updated ZOOKEEPER-591:
---

 Priority: Critical  (was: Major)
Fix Version/s: 3.3.0

Upping the priority and assigning to 3.3.0

 The C Client cannot exit properly in some situation
 ---

 Key: ZOOKEEPER-591
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-591
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1
 Environment: Linux db-passport-test05.vm 2.6.9_5-4-0-5 #1 SMP Tue Apr 
 14 15:56:24 CST 2009 x86_64 x86_64 x86_64 GNU/Linux 
Reporter: Qian Ye
Priority: Critical
 Fix For: 3.3.0


 The following code produce a situation, where the C Client can not exit 
 properly,
 #include include/zookeeper.h
 void default_zoo_watcher(zhandle_t *zzh, int type, int state, const char 
 *path, void* context){
 int zrc = 0;
 struct String_vector str_vec = {0, NULL};
 printf(in the default_zoo_watcher\n);
 zrc = zoo_wget_children(zzh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 return;
 }
 int main()
 {
 int zrc = 0;
 int buff_len = 10; 
 char buff[10] = hello;
 char path[512];
 struct Stat stat;
 struct String_vector str_vec = {0, NULL};
 zhandle_t *zh = zookeeper_init(10.81.20.62:2181, NULL, 3, 0, 0, 0); 
 zrc = zoo_create(zh, /mytest, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, path, 
 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_create(zh, /mytest/test1, buff, 10, ZOO_OPEN_ACL_UNSAFE, 0, 
 path, 512);
 printf(zoo_create, error: %d\n, zrc);
 zrc = zoo_wget_children(zh, /mytest, default_zoo_watcher, NULL, 
 str_vec);
 printf(zoo_wget_children, error: %d\n, zrc);
 zrc = zoo_delete(zh, /mytest/test1, -1);
 printf(zoo_delete, error: %d\n, zrc);
 zookeeper_close(zh);
 return 0;
 }
 running this code can cause the program hang at zookeeper_close(zh);(line 
 38). using gdb to attach the process, I found that the main thread is waiting 
 for do_completion thread to finish,
 (gdb) bt
 #0  0x00302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
 #1  0x0040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
 #2  0x004060ba in zookeeper_close (zh=0x515b60) at 
 src/zookeeper.c:2100
 #3  0x0040220b in main ()
 and the thread which handle the zoo_wget_children(in the default_zoo_watcher) 
 is waiting for sc-cond. 
 (gdb) thread 2
 [Switching to thread 2 (Thread 1094719840 (LWP 25093))]#0  0x00302b8089aa 
 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
 (gdb) bt
 #0  0x00302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from 
 /lib64/tls/libpthread.so.0
 #1  0x0040d88b in wait_sync_completion (sc=0x5167f0) at 
 src/mt_adaptor.c:82
 #2  0x004082c9 in zoo_wget_children (zh=0x515b60, path=0x40ebc0 
 /mytest, watcher=0x401fd8 default_zoo_watcher, watcherCtx=Variable 
 watcherCtx is not available.)
 at src/zookeeper.c:2884
 #3  0x00402037 in default_zoo_watcher ()
 #4  0x0040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, 
 path=0x515100 /mytest, list=0x5177d8) at src/zk_hashtable.c:274
 #5  0x00403861 in process_completions (zh=0x515b60) at 
 src/zookeeper.c:1631
 #6  0x0040e1b5 in do_completion (v=Variable v is not available.) at 
 src/mt_adaptor.c:333
 #7  0x00302b80610a in start_thread () from /lib64/tls/libpthread.so.0
 #8  0x00302afc6003 in clone () from /lib64/tls/libc.so.6
 #9  0x in ?? ()
 here, a deadlock presents.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.