CESNET / libnetconf

C NETCONF library
Other
113 stars 83 forks source link

Notification thread never exits on netconf server crash #193

Closed krishnanbalaji closed 8 years ago

krishnanbalaji commented 8 years ago

Hello, I am using only libnetconf just as a netconf client. My client has subscribed - ncntf_dispatch_receive() for notification. I have this situation where netconf server has crashed, but my notification receiver thread fails to get out of the loop in ncntf_dispatch_stop() which waits for someone set session->ntf_active to 0. This is a deadlock scenario. Seems to be a bug. Has anyone faced it?

Would appreciate a graceful way out rather than killing the respective thread through other means.

My relevant stack trace is like:

0 0x00007f9841ab0f2d in nanosleep () at ../sysdeps/unix/syscall-template.S:81

1 0x00007f9841ad9204 in usleep (useconds=) at ../sysdeps/unix/sysv/linux/usleep.c:32

2 0x00007f98414382f2 in ncntf_dispatch_stop (session=0x21d1020)

at src/notifications.c:2326

3 0x00007f984142b939 in nc_session_close (session=0x21d1020,

reason=NC_SESSION_TERM_DROPPED) at src/session.c:1194

4 0x00007f984142cc01 in nc_session_receive (session=0x21d1020, timeout=0,

msg=0x7f983a9e9e60) at src/session.c:1970

5 0x00007f984142d4a5 in nc_session_recv_msg (session=0x21d1020, timeout=0,

msg=0x7f983a9e9e60) at src/session.c:2185

6 0x00007f984142d986 in nc_session_recv_notif (session=0x21d1020, timeout=0,

ntf=0x7f983a9e9ea0) at src/session.c:2364

Regards Balaji

michalvasko commented 8 years ago

Hi Balaji, this a design problem, which will be fixed (but not in too proper way) soon. You can give a try to netopeer2-cli, which should work much more reliably.

Regards, Michal

krishnanbalaji commented 8 years ago

Thanks, Michael.

I haven't checked the code of netopeer2-cli. May be, I get an idea to change my client code.

Will get back.

Regards, Balaji On May 19, 2016 8:33 PM, "michalvasko" notifications@github.com wrote:

Hi Balaji, this a design problem, which will be fixed (but not in too proper way) soon. You can give a try to netopeer2-cli https://github.com/cesnet/netopeer2, which should work much more reliably.

Regards, Michal

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/CESNET/libnetconf/issues/193#issuecomment-220352419