~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/slave/queue_producer.cc

  • Committer: Lee Bieber
  • Date: 2011-02-28 23:00:55 UTC
  • mfrom: (2208.1.4 build)
  • Revision ID: kalebral@gmail.com-20110228230055-g9cq8faquzm5cvpi
Merge Olaf - Remove Session::change_item_tree
Merge Shrew/Joe - 720908: slave will not reconnect if initial connection to master is unsuccessful
Merge Shrews - 723923: Make sleep intervals for slave plugin configurable
Merge Patrck - 726784: dbqp not properly resetting itself after a test failure 

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
bool QueueProducer::init()
44
44
{
45
45
  setIOState("", true);
46
 
  return openConnection();
 
46
  return reconnect(true);
47
47
}
48
48
 
49
49
bool QueueProducer::process()
54
54
    {
55
55
      if (_last_return == DRIZZLE_RETURN_LOST_CONNECTION)
56
56
      {
57
 
        if (reconnect())
 
57
        if (reconnect(false))
58
58
        {
59
59
          return true;    /* reconnect successful, try again */
60
60
        }
75
75
  {
76
76
    if (_last_return == DRIZZLE_RETURN_LOST_CONNECTION)
77
77
    {
78
 
      if (reconnect())
 
78
      if (reconnect(false))
79
79
      {
80
80
        return true;    /* reconnect successful, try again */
81
81
      }
101
101
    closeConnection();
102
102
}
103
103
 
104
 
bool QueueProducer::reconnect()
 
104
bool QueueProducer::reconnect(bool initial_connection)
105
105
{
106
 
  errmsg_printf(error::ERROR, _("Lost connection to master. Reconnecting."));
 
106
  if (not initial_connection)
 
107
  {
 
108
    errmsg_printf(error::ERROR, _("Lost connection to master. Reconnecting."));
 
109
  }
107
110
 
108
111
  _is_connected= false;
109
112
  _last_return= DRIZZLE_RETURN_OK;