{"action":"created","issue":{"url":"https://api.github.com/repos/edenhill/librdkafka/issues/714","repository_url":"https://api.github.com/repos/edenhill/librdkafka","labels_url":"https://api.github.com/repos/edenhill/librdkafka/issues/714/labels{/name}","comments_url":"https://api.github.com/repos/edenhill/librdkafka/issues/714/comments","events_url":"https://api.github.com/repos/edenhill/librdkafka/issues/714/events","html_url":"https://github.com/edenhill/librdkafka/issues/714","id":163516667,"number":714,"title":"rd_kafka_destroy_app can get stuck in pthread_join","user":{"login":"arnaud-lb","id":365207,"avatar_url":"https://avatars.githubusercontent.com/u/365207?v=3","gravatar_id":"","url":"https://api.github.com/users/arnaud-lb","html_url":"https://github.com/arnaud-lb","followers_url":"https://api.github.com/users/arnaud-lb/followers","following_url":"https://api.github.com/users/arnaud-lb/following{/other_user}","gists_url":"https://api.github.com/users/arnaud-lb/gists{/gist_id}","starred_url":"https://api.github.com/users/arnaud-lb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arnaud-lb/subscriptions","organizations_url":"https://api.github.com/users/arnaud-lb/orgs","repos_url":"https://api.github.com/users/arnaud-lb/repos","events_url":"https://api.github.com/users/arnaud-lb/events{/privacy}","received_events_url":"https://api.github.com/users/arnaud-lb/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2016-07-02T12:33:52Z","updated_at":"2016-09-30T21:33:49Z","closed_at":"2016-08-29T11:22:21Z","body":"Description\r\n===========\r\n\r\nrd_kafka_destroy_app can get stuck in pthread_join:\r\n\r\n```\r\n(gdb) bt\r\n#0  0x00006484f5b47ee5 in pthread_join (threadid=threadid@entry=110521919223552, thread_return=thread_return@entry=0x723bd55d3508) at pthread_join.c:89\r\n#1  0x00006484ec0da932 in thrd_join (thr=thr@entry=110521919223552, res=res@entry=0x0) at tinycthread.c:732\r\n#2  0x00006484ec09e6bb in rd_kafka_destroy_app (rk=0x3521360, blocking=<optimized out>) at rdkafka.c:504\r\n#3  rd_kafka_destroy (rk=0x3521360) at rdkafka.c:512\r\n```\r\n\r\nHere is the backtrace of the other thread:\r\n\r\n```\r\n(gdb) bt\r\n#0  rd_kafka_timers_destroy (rkts=rkts@entry=0x35217f0) at rdkafka_timer.c:251\r\n#1  0x00006484ec09e29a in rd_kafka_destroy_final (rk=rk@entry=0x3521360) at rdkafka.c:455\r\n#2  0x00006484ec09e615 in rd_kafka_thread_main (arg=arg@entry=0x3521360) at rdkafka.c:991\r\n#3  0x00006484ec0da56f in _thrd_wrapper_function (aArg=<optimized out>) at tinycthread.c:611\r\n#4  0x00006484f5b46b50 in start_thread (arg=<optimized out>) at pthread_create.c:304\r\n#5  0x00006484f605030d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112\r\n#6  0x0000000000000000 in ?? ()\r\n```\r\n\r\nThe thread is stuck in this loop:\r\n\r\n```\r\n251\t        while ((rtmr = TAILQ_FIRST(&rkts->rkts_timers)))\r\n252\t                rd_kafka_timer_stop(rkts, rtmr, 0);\r\n````\r\n\r\n`rtmr` is always the same address. It seems that `rtmr->rtmr_interval` is 0\r\n\r\nHow to reproduce\r\n================\r\n\r\nIt happens after consuming a lot of messages and then destroying the app. This is a long running process, and I don't have logs enabled yet. Which logs would be the most useful if enabled ?\r\n\r\nChecklist\r\n=========\r\nPlease provide the following information:\r\n\r\n - [x] librdkafka version: tag: 0.9.1\r\n - [x] Apache Kafka version: 0.8.2\r\n - [ ] librdkafka client configuration: \r\n - [x] Operating system: Debian 7.8, Linux 3.14.32-xxxx-grs-ipv6-64\r\n - [x] Using the legacy Consumer\r\n - [ ] Using the high-level KafkaConsumer\r\n - [ ] Provide logs (with `debug=..` as necessary) from librdkafka\r\n - [ ] Provide broker log excerpts\r\n - [x] Critical issue\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/edenhill/librdkafka/issues/comments/250857645","html_url":"https://github.com/edenhill/librdkafka/issues/714#issuecomment-250857645","issue_url":"https://api.github.com/repos/edenhill/librdkafka/issues/714","id":250857645,"user":{"login":"arnaud-lb","id":365207,"avatar_url":"https://avatars.githubusercontent.com/u/365207?v=3","gravatar_id":"","url":"https://api.github.com/users/arnaud-lb","html_url":"https://github.com/arnaud-lb","followers_url":"https://api.github.com/users/arnaud-lb/followers","following_url":"https://api.github.com/users/arnaud-lb/following{/other_user}","gists_url":"https://api.github.com/users/arnaud-lb/gists{/gist_id}","starred_url":"https://api.github.com/users/arnaud-lb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arnaud-lb/subscriptions","organizations_url":"https://api.github.com/users/arnaud-lb/orgs","repos_url":"https://api.github.com/users/arnaud-lb/repos","events_url":"https://api.github.com/users/arnaud-lb/events{/privacy}","received_events_url":"https://api.github.com/users/arnaud-lb/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T21:33:49Z","updated_at":"2016-09-30T21:33:49Z","body":"Yes, it must be the case as well. It didn't seem necessary in 0.8.x though ?"}}
{"actor":{"display_login":"arnaud-lb"}}