Comment 10 for bug 821732

Revision history for this message
Ante Karamatić (ivoks) wrote : Re: socket leak in lrmd

Howto test bug and fix

Install lucid
add ubuntu-ha-maintainers ppa and update repo:
        apt-add-repository ppa:ubuntu-ha-maintainers/ppa ; apt-get update
Install pacemaker:
        apt-get -y install pacemaker
Enable corosync (/etc/default/corosync) and start it:
        sed -i -e 's/START=no/START=yes/' /etc/default/corosync ; \
        service corosync start
Open few client->server connections:
        lrmadmin -C ; lrmadmin -C ; lrmadmin -C ; lrmadmin -C
Check number of open sockets:
        lsof -f | grep lrm_callback_sock | wc -l
Correct value is 2, but it will be 6 or 8. There's a socket leak.

Stop corosync:
        service corosync stop
Add ppa:ivoks/ha:
        apt-add-repository ppa:ivoks/ha ; apt-get update ; apt-get -y upgrade
Start corosync:
        service corosync start
Repeate the test with client->server connections:
        lrmadmin -C ; lrmadmin -C
It deadlocks on second run

Kill lrmd and stop corosync:
        killall -9 lrmd ; service corosync stop
Add ppa:ivoks/glib:
        apt-add-repository ppa:ivoks/glib ; apt-get update ; apt-get -y upgrade
Start corosync:
        service corosync start
Run the test again:
        lrmadmin -C ; lrmadmin -C ; lrmadmin -C ; lrmadmin -C
It doesn't deadlock.
Check the socket count:
        lsof -f | grep lrm_callback_sock | wc -l
It's 2. Socket do not leak and glib doesn't deadlock.