IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31490


Ignore:
Timestamp:
May 6, 2011, 6:32:50 PM (15 years ago)
Author:
watersc1
Message:

fix race condition between load/run tasks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20110505/ippTasks/lap.pro

    r31487 r31490  
    172172    ipptool2book stdout lapNewRuns -uniq -key lap_id -setword dbname $options:0 -setword pantaskState INIT
    173173
     174    process_cleanup lapNewRuns
     175
    174176    if ($VERBOSE > 2)
    175177      book listbook lapNewRuns
     
    207209
    208210
    209     book getpage lapNewRuns $lap_NewPage -var lapNewPageName
     211    book getpage lapNewRuns -var lapNewPageName -key pantaskState INIT
    210212
    211213    $lap_NewPage ++
    212214    if ($lap_NewPage >= $N) set lap_NewPage = 0
    213 
    214215
    215216    if ("$lapNewPageName" == "NULL") break
     
    220221
    221222    option $LAP_ID
    222     book delpage lapNewRuns $LAP_ID
    223223
    224224    $run = lap_science.pl --chip_mode --dbname $DBNAME --lap_id $LAP_ID
     
    230230  # success
    231231  task.exit  0
     232    process_exit lapNewRuns $options:0 0
    232233    if ($VERBOSE > 2)
    233234      book listbook lapNewRuns
     
    236237  # locked list
    237238  task.exit    default
    238     showcommand failure
    239   end
    240   task.exit    crash
    241     showcommand crash
    242   end
    243   #operation times out?
    244   task.exit    timeout
     239    process_exit lapNewRuns $options:0 0
     240    showcommand failure
     241  end
     242  task.exit    crash
     243    process_exit lapNewRuns $options:0 0
     244    showcommand crash
     245  end
     246  #operation times out?
     247  task.exit    timeout
     248    process_exit lapNewRuns $options:0 0
    245249    showcommand timeout
    246250  end
     
    286290  task.exit  0
    287291    ipptool2book stdout lapRunRuns -uniq -key lap_id -setword dbname $options:0 -setword pantaskState INIT
     292   
     293    process_cleanup lapRunRuns
    288294
    289295    if ($VERBOSE > 2)
     
    323329
    324330
    325     book getpage lapRunRuns $lap_RunPage -var lapRunPageName
     331    book getpage lapRunRuns -var lapRunPageName -key pantaskState INIT
    326332
    327333    $lap_RunPage ++
     
    335341
    336342    option $LAP_ID
    337     book delpage lapRunRuns $LAP_ID
    338343
    339344    $run = lap_science.pl --monitor_mode --dbname $DBNAME --lap_id $LAP_ID
     
    345350  # success
    346351  task.exit  0
    347     if ($VERBOSE > 2)
     352    process_exit lapRunRuns $options:0 0
     353    if ($VERBOSE > 2)
     354
    348355      book listbook lapRunRuns
    349356    end
     
    351358  # locked list
    352359  task.exit    default
    353     showcommand failure
    354   end
    355   task.exit    crash
    356     showcommand crash
    357   end
    358   #operation times out?
    359   task.exit    timeout
     360    process_exit lapRunRuns $options:0 0
     361    showcommand failure
     362  end
     363  task.exit    crash
     364    process_exit lapRunRuns $options:0 0
     365    showcommand crash
     366  end
     367  #operation times out?
     368  task.exit    timeout
     369    process_exit lapRunRuns $options:0 0
    360370    showcommand timeout
    361371  end
     
    402412    ipptool2book stdout lapDoneRuns -uniq -key lap_id  -setword dbname $options:0 -setword pantaskState INIT
    403413
     414    process_cleanup lapDoneRuns
    404415    if ($VERBOSE > 2)
    405416      book listbook lapRuns
     
    437448
    438449
    439     book getpage lapDoneRuns $lap_DonePage -var lapDonePageName
     450    book getpage lapDoneRuns -var lapDonePageName -key pantaskState INIT
    440451
    441452    $lap_DonePage ++
     
    448459    book getword lapDoneRuns $lapDonePageName dbname -var DBNAME
    449460
    450     book delpage lapDoneRuns $LAP_ID
    451 
     461    option $LAP_ID
    452462    $run = lap_science.pl --cleanup_mode --dbname $DBNAME --lap_id $LAP_ID
    453463
     
    458468  # success
    459469  task.exit  0
    460 
     470    process_exit lapDoneRuns $options:0 0
    461471    if ($VERBOSE > 2)
    462472      book listbook lapDoneRuns
     
    465475  # locked list
    466476  task.exit    default
    467     showcommand failure
    468   end
    469   task.exit    crash
    470     showcommand crash
    471   end
    472   #operation times out?
    473   task.exit    timeout
    474     showcommand timeout
    475   end
    476 end
     477    process_exit lapDoneRuns $options:0 0
     478    showcommand failure
     479  end
     480  task.exit    crash
     481    process_exit lapDoneRuns $options:0 0
     482    showcommand crash
     483  end
     484  #operation times out?
     485  task.exit    timeout
     486    process_exit lapDoneRuns $options:0 0
     487    showcommand timeout
     488  end
     489end
Note: See TracChangeset for help on using the changeset viewer.