Review Board 1.7.22


QPID-3438 -- cluster auth failure increments cnx count

Review Request #1591 - Created Aug. 19, 2011 and updated

mick goulish
Reviewers
aconway, gordon, tross
qpid
QPID-3438 -- the cnx failure happens before the cnx is fully open, so at that point in the cluster code we have to tell the broker to decrement its counter-of-connections.
starting the broker
{
#! /bin/bash

QPIDD_SRC=$TRUNK/qpid/cpp/src
QPIDD=$QPIDD_SRC/.libs/qpidd

echo $QPIDD

rm -rf /tmp/mick
mkdir /tmp/mick


  $QPIDD                                      \
    --no-module-dir                           \
    --load-module $QPIDD_SRC/.libs/cluster.so \
    --cluster-name micks_test_cluster         \
    --max-connections=12                      \
    -p 5813                                   \
    --data-dir /tmp/mick/data_1               \
    --auth=yes                                \
    --mgmt-enable=no                          \
    --log-enable info+                        \
    --log-to-file /tmp/mick/qpidd_1.log       \
    --log-source yes                          \
    -d

  echo "started broker from $QPIDD"

}


running the client
{
#! /bin/bash

let count=1

while [ $count -lt 14 ]
do 
  echo "ITERATION $count -----------------------------"
  let count+=1
  /home/mick/trunk/qpid/cpp/examples/messaging/drain -b localhost:5813 amq.topic --connection-options '{sasl_mechanisms:PLAIN, username:blah, password:blah}'
done
}



result before fix
{
      ...

      ITERATION 11 -----------------------------
      2011-08-19 13:13:35 warning Broker closed connection: 320, connection-forced: Authentication failed
      connection-forced: Authentication failed
      ITERATION 12 -----------------------------
      connection-forced: Authentication failed
      2011-08-19 13:13:35 warning Broker closed connection: 320, connection-forced: Authentication failed
      ITERATION 13 -----------------------------
      2011-08-19 13:13:35 warning Connection [127.0.0.1:46881-localhost:5813] closed
      Failed to connect (reconnect disabled)
      # NOTE: broker has become upset.  No connections remaining.
    }


    after
    {
      ...
      ITERATION 11 -----------------------------
      2011-08-19 13:26:27 warning Broker closed connection: 320, connection-forced: Authentication failed
      connection-forced: Authentication failed
      ITERATION 12 -----------------------------
      connection-forced: Authentication failed
      2011-08-19 13:26:27 warning Broker closed connection: 320, connection-forced: Authentication failed
      ITERATION 13 -----------------------------
      2011-08-19 13:26:27 warning Broker closed connection: 320, connection-forced: Authentication failed
      connection-forced: Authentication failed
      # NOTE: Cnx fails (as it should) but broker not upset.
    }

Posted (Aug. 19, 2011, 6:44 p.m.)

   

  
The connection count will be decremented when the qpid::broker::Connection object is deleted.

While this change will fix the count, it will still mean the connection object is not deleted.

I.e. I think it is at most a partial fix (though it does take care of the most critical symptom).