Changeset 78

Show
Ignore:
Timestamp:
12/23/09 19:10:04 (4 years ago)
Author:
jesus
Message:

be more aggressive on connection errors for autonomous publishes and the first publish in a txn group

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/contrib/pg_amqp/pg_amqp.c

    r76 r78  
    257257  if(!PG_ARGISNULL(0)) { 
    258258    int broker_id; 
     259    int once_more = 1; 
    259260    broker_id = PG_GETARG_INT32(0); 
     261  redo: 
    260262    bs = local_amqp_get_bs(broker_id); 
    261263    if(bs && bs->conn && (channel == 1 || !bs->inerror)) { 
     
    275277      reply = amqp_get_rpc_reply(); 
    276278      if(rv || reply->reply_type != AMQP_RESPONSE_NORMAL) { 
     279        if(once_more && (channel == 1 || bs->uncommitted == 0)) { 
     280          once_more = 0; 
     281          local_amqp_disconnect_bs(bs); 
     282          goto redo; 
     283        } 
    277284        bs->inerror = 1; 
    278285        PG_RETURN_BOOL(0 != 0);