You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Qian Ye (JIRA)" <ji...@apache.org> on 2009/11/23 10:36:40 UTC
[jira] Created: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
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
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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
#1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
#2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
#3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
(gdb) bt
#0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
#1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
#2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
#4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
#5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
#6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
#7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
#8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
#9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846324#action_12846324 ]
Hadoop QA commented on ZOOKEEPER-591:
-------------------------------------
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12438988/ZOOKEEPER-591_1.patch
against trunk revision 924065.
+1 @author. The patch does not contain any @author tags.
+1 tests included. The patch appears to include 5 new or modified tests.
+1 javadoc. The javadoc tool did not generate any warning messages.
+1 javac. The applied patch does not increase the total number of javac compiler warnings.
+1 findbugs. The patch does not introduce any new Findbugs warnings.
+1 release audit. The applied patch does not increase the total number of release audit warnings.
-1 core tests. The patch failed core unit tests.
+1 contrib tests. The patch passed contrib unit tests.
Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/29/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/29/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/29/console
This message is automatically generated.
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843789#action_12843789 ]
Hadoop QA commented on ZOOKEEPER-591:
-------------------------------------
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12438438/ZOOKEEPER-591.patch
against trunk revision 921509.
+1 @author. The patch does not contain any @author tags.
-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.
+1 javadoc. The javadoc tool did not generate any warning messages.
+1 javac. The applied patch does not increase the total number of javac compiler warnings.
+1 findbugs. The patch does not introduce any new Findbugs warnings.
+1 release audit. The applied patch does not increase the total number of release audit warnings.
+1 core tests. The patch passed core unit tests.
+1 contrib tests. The patch passed contrib unit tests.
Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/11/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/11/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/11/console
This message is automatically generated.
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Qian Ye (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844391#action_12844391 ]
Qian Ye commented on ZOOKEEPER-591:
-----------------------------------
This patch works for me, thx 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Qian Ye (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801661#action_12801661 ]
Qian Ye commented on ZOOKEEPER-591:
-----------------------------------
The reason of the deadlock is that the io thread didn't check whether there is some sync commands still in processing, before it returned. I think some kind of pending sync commands and thread mutex should be added to make sure the zookeeper handler can be closed properly. Has anyone have a look at this bug yet?
> 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
>
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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_2.patch
this patch should fix the hang. The return code was wrong in queue_completions() which made calls hang!
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Assigned: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Hunt reassigned ZOOKEEPER-591:
--------------------------------------
Assignee: Benjamin Reed
> 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: Benjamin Reed
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Hunt updated ZOOKEEPER-591:
-----------------------------------
Resolution: Fixed
Status: Resolved (was: Patch Available)
+1 on the latest patch. This seems to address the issue, no longer hanging on my machine, also not hanging on some other systems I tested (was hanging before). Great 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, 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846607#action_12846607 ]
Hadoop QA commented on ZOOKEEPER-591:
-------------------------------------
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12439082/ZOOKEEPER-591_2.patch
against trunk revision 924147.
+1 @author. The patch does not contain any @author tags.
-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.
+1 javadoc. The javadoc tool did not generate any warning messages.
+1 javac. The applied patch does not increase the total number of javac compiler warnings.
+1 findbugs. The patch does not introduce any new Findbugs warnings.
+1 release audit. The applied patch does not increase the total number of release audit warnings.
+1 core tests. The patch passed core unit tests.
+1 contrib tests. The patch passed contrib unit tests.
Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/30/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/30/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/30/console
This message is automatically generated.
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844263#action_12844263 ]
Hadoop QA commented on ZOOKEEPER-591:
-------------------------------------
+1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12438547/ZOOKEEPER-591.patch
against trunk revision 921853.
+1 @author. The patch does not contain any @author tags.
+1 tests included. The patch appears to include 5 new or modified tests.
+1 javadoc. The javadoc tool did not generate any warning messages.
+1 javac. The applied patch does not increase the total number of javac compiler warnings.
+1 findbugs. The patch does not introduce any new Findbugs warnings.
+1 release audit. The applied patch does not increase the total number of release audit warnings.
+1 core tests. The patch passed core unit tests.
+1 contrib tests. The patch passed contrib unit tests.
Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/13/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/13/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/13/console
This message is automatically generated.
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841941#action_12841941 ]
Mahadev konar commented on ZOOKEEPER-591:
-----------------------------------------
ben, did you get a chance to take a look at it ?
> 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: Benjamin Reed
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846376#action_12846376 ]
Hudson commented on ZOOKEEPER-591:
----------------------------------
Integrated in ZooKeeper-trunk #754 (See [http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/754/])
. The C Client cannot exit properly in some situation (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, 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Reopened: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Hunt reopened ZOOKEEPER-591:
------------------------------------
this occassionally hangs for me, had to ctrl-c to kill it:
[exec] Zookeeper_simpleSystem::testAcl : elapsed 1022 : OK
[exec] Zookeeper_simpleSystem::testChroot : elapsed 3166 : OK
[exec] Zookeeper_simpleSystem::testAuth ZooKeeper server started : elapsed 25773 : OK
[exec] make: *** wait: No child processes. Stop.
[exec] make: *** Waiting for unfinished jobs....
[exec] make: *** wait: No child processes. Stop.
[exec] Zookeeper_simpleSystem::testHangingClient
BUILD FAILED
/home/phunt/dev/workspace/gitzk/build.xml:866: The following error occurred while executing this line:
/home/phunt/dev/workspace/gitzk/build.xml:877: exec returned: 2
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844179#action_12844179 ]
Patrick Hunt commented on ZOOKEEPER-591:
----------------------------------------
This test case from qian, we plan to add this to the c unit tests right?
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Assigned: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mahadev konar reassigned ZOOKEEPER-591:
---------------------------------------
Assignee: Mahadev konar (was: Benjamin Reed)
> 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
>
>
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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
here is the updated patch. Qian can you try it out as soon as possible?
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843394#action_12843394 ]
Hadoop QA commented on ZOOKEEPER-591:
-------------------------------------
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12438345/ZOOKEEPER-591.patch
against trunk revision 921117.
+1 @author. The patch does not contain any @author tags.
-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.
+1 javadoc. The javadoc tool did not generate any warning messages.
+1 javac. The applied patch does not increase the total number of javac compiler warnings.
+1 findbugs. The patch does not introduce any new Findbugs warnings.
+1 release audit. The applied patch does not increase the total number of release audit warnings.
+1 core tests. The patch passed core unit tests.
+1 contrib tests. The patch passed contrib unit tests.
Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/6/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/6/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/6/console
This message is automatically generated.
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844113#action_12844113 ]
Mahadev konar commented on ZOOKEEPER-591:
-----------------------------------------
Qian,
I can reproduce this as well on trunk. Yes, my patch does not fix the bug. I am still working on it.
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Qian Ye (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843443#action_12843443 ]
Qian Ye commented on ZOOKEEPER-591:
-----------------------------------
Hi Mahadev, the patch doesn't work :-(, the deadlock still exist.
(gdb) info thread
2 Thread 1094719840 (LWP 13889) 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
1 Thread 182894113888 (LWP 13887) 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
(gdb) thread 1
[Switching to thread 1 (Thread 182894113888 (LWP 13887))]#0 0x000000302b806ffb in pthread_join ()
from /lib64/tls/libpthread.so.0
(gdb) bt
#0 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
#1 0x000000000040de2b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:218
#2 0x00000000004060aa in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2086
#3 0x000000000040220b in main ()
(gdb) thread 2
[Switching to thread 2 (Thread 1094719840 (LWP 13889))]#0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
(gdb) bt
#0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
#1 0x000000000040d87b in wait_sync_completion (sc=0x517850) at src/mt_adaptor.c:82
#2 0x00000000004082b9 in zoo_wget_children (zh=0x515b60, path=0x40eba0 "/mytest",
watcher=0x401fd8 <default_zoo_watcher>, watcherCtx=Variable "watcherCtx" is not available.
) at src/zookeeper.c:2866
#3 0x0000000000402037 in default_zoo_watcher ()
#4 0x000000000040d654 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x516920 "/mytest",
list=0x5177d8) at src/zk_hashtable.c:271
#5 0x0000000000403871 in process_completions (zh=0x515b60) at src/zookeeper.c:1620
#6 0x000000000040e1a5 in do_completion (v=Variable "v" is not available.
) at src/mt_adaptor.c:332
#7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
#8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
#9 0x0000000000000000 in ?? ()
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Qian Ye (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843870#action_12843870 ]
Qian Ye commented on ZOOKEEPER-591:
-----------------------------------
The process still hang there, Mahadev.
(gdb) info thread
2 Thread 1094719840 (LWP 31877) 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
1 Thread 182894113888 (LWP 31875) 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
(gdb) thread 1
[Switching to thread 1 (Thread 182894113888 (LWP 31875))]#0 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
(gdb) bt
#0 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
#1 0x000000000040de5b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:218
#2 0x00000000004060da in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2109
#3 0x000000000040220b in main ()
(gdb) thread 2
[Switching to thread 2 (Thread 1094719840 (LWP 31877))]#0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib64/tls/libpthread.so.0
(gdb) bt
#0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
#1 0x000000000040d8ab in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
#2 0x00000000004082e9 in zoo_wget_children (zh=0x515b60, path=0x40ebe0 "/mytest", watcher=0x401fd8 <default_zoo_watcher>, watcherCtx=Variable "watcherCtx" is not available.
)
at src/zookeeper.c:2889
#3 0x0000000000402037 in default_zoo_watcher ()
#4 0x000000000040d684 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x2a95700b08) at src/zk_hashtable.c:271
#5 0x0000000000403771 in process_completions (zh=0x515b60) at src/zookeeper.c:1623
#6 0x000000000040e1d5 in do_completion (v=Variable "v" is not available.
) at src/mt_adaptor.c:332
#7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
#8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
#9 0x0000000000000000 in ?? ()
I patched the patch to the c client source code version 3.2.2, not the working copy, I think this won't make any difference, right?
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844181#action_12844181 ]
Mahadev konar commented on ZOOKEEPER-591:
-----------------------------------------
i think we can .... am working on including it as soon as we figure out the fix.....
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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_1.patch
patch that applies to the trunk.
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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_1.patch
the last patch had a bug which is fixed in this patch.
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ 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
>
>
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846624#action_12846624 ]
Hudson commented on ZOOKEEPER-591:
----------------------------------
Integrated in ZooKeeper-trunk #755 (See [http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/755/])
. The C Client cannot exit properly in some situation
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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] Commented: (ZOOKEEPER-591) The C Client cannot exit properly
in some situation
Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844245#action_12844245 ]
Hadoop QA commented on ZOOKEEPER-591:
-------------------------------------
-1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12438540/ZOOKEEPER-591.patch
against trunk revision 921853.
+1 @author. The patch does not contain any @author tags.
-1 tests included. The patch doesn't appear to include any new or modified tests.
Please justify why no tests are needed for this patch.
+1 javadoc. The javadoc tool did not generate any warning messages.
+1 javac. The applied patch does not increase the total number of javac compiler warnings.
+1 findbugs. The patch does not introduce any new Findbugs warnings.
+1 release audit. The applied patch does not increase the total number of release audit warnings.
+1 core tests. The patch passed core unit tests.
+1 contrib tests. The patch passed contrib unit tests.
Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/12/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/12/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/12/console
This message is automatically generated.
> 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, 30000, 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 0x000000302b806ffb in pthread_join () from /lib64/tls/libpthread.so.0
> #1 0x000000000040de3b in adaptor_finish (zh=0x515b60) at src/mt_adaptor.c:219
> #2 0x00000000004060ba in zookeeper_close (zh=0x515b60) at src/zookeeper.c:2100
> #3 0x000000000040220b 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 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 ()
> from /lib64/tls/libpthread.so.0
> (gdb) bt
> #0 0x000000302b8089aa in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/tls/libpthread.so.0
> #1 0x000000000040d88b in wait_sync_completion (sc=0x5167f0) at src/mt_adaptor.c:82
> #2 0x00000000004082c9 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 0x0000000000402037 in default_zoo_watcher ()
> #4 0x000000000040d664 in deliverWatchers (zh=0x515b60, type=4, state=3, path=0x515100 "/mytest", list=0x5177d8) at src/zk_hashtable.c:274
> #5 0x0000000000403861 in process_completions (zh=0x515b60) at src/zookeeper.c:1631
> #6 0x000000000040e1b5 in do_completion (v=Variable "v" is not available.) at src/mt_adaptor.c:333
> #7 0x000000302b80610a in start_thread () from /lib64/tls/libpthread.so.0
> #8 0x000000302afc6003 in clone () from /lib64/tls/libc.so.6
> #9 0x0000000000000000 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.