[acassen/keepalived] afea07: vrrp: fix double close issue (DROP_MEMBERSHIP & ne...

Alexandre Cassen <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <5371169816fd4_29f2ff5d34115264@hookshot-fe2-cp1-prd.iad.github.net.mail>
  Branch: refs/heads/master
  Home:   https://github.com/acassen/keepalived
  Commit: afea07bd94384c8ac8125e8cdbfd18bc4a46b14e
      https://github.com/acassen/keepalived/commit/afea07bd94384c8ac8125e8cdbfd18bc4a46b14e
  Author: Alexandre Cassen <[email protected]>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M keepalived/include/vrrp_data.h
    M keepalived/include/vrrp_netlink.h
    M keepalived/vrrp/vrrp_daemon.c
    M keepalived/vrrp/vrrp_data.c
    M keepalived/vrrp/vrrp_if.c
    M keepalived/vrrp/vrrp_netlink.c
    M keepalived/vrrp/vrrp_scheduler.c
    M lib/scheduler.c
    M lib/scheduler.h

  Log Message:
  -----------
  vrrp: fix double close issue (DROP_MEMBERSHIP & netlink channel)

This is a old pending 'bug', not arming at all but just frustrating
to see again and again this log message :

"cant do IP_DROP_MEMBERSHIP errno=Bad file descriptor (9)"

What the hell ! it was due to a double close during reload &
stop procedure. VRRP fd are stored in a socket pool and use
the I/O MUX to handle VRRP traffic. While reloading or stopping
the daemon the I/O MUX was released first and secondly socket pool.
The issue spotted here, in thread_destroy_master() all pending
thread are canceled and read/write fds related are close().

Well OK a close on a mcast socket perform kernel side the
DROP_MEMBERSHIP when needed, but it is much more clean to
perform proper operations userspace !

This patch sequencely cancel pending thread, release socket pool
and finally destroy master thread.

Same 'issue' appear in netlink channel.

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs

_______________________________________________
Keepalived-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.