Changeset 41


Ignore:
Timestamp:
10/29/11 22:59:11 (12 years ago)
Author:
mmamonski
Message:

drmaa_init - fault tolerant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pbs_drmaa/session.c

    r33 r41  
    120120                self->status_attrl = pbsdrmaa_create_status_attrl(); 
    121121 
     122         {      /* ugly. But this is life... ;( */ 
     123                #define MAX_PBS_CONNECT_RETRIES (3) 
     124                int tries_counter = MAX_PBS_CONNECT_RETRIES; 
     125             retry: 
    122126                self->pbs_conn = pbs_connect( self->super.contact ); 
    123127                fsd_log_info(( "pbs_connect(%s) =%d", self->super.contact, 
    124128                                        self->pbs_conn )); 
     129                if( self->pbs_conn < 0 && tries_counter-- ) 
     130                 { 
     131                        sleep(1); 
     132                        goto retry; 
     133                 } 
     134         } 
    125135                if( self->pbs_conn < 0 ) 
    126136                        pbsdrmaa_exc_raise_pbs( "pbs_connect" ); 
     
    139149                        self = NULL; 
    140150                  } 
     151 
     152                fsd_exc_reraise(); 
    141153         } 
    142154        END_TRY 
Note: See TracChangeset for help on using the changeset viewer.