Changeset 27840 for branches/simtest_nebulous_branches/ippTasks/pstamp.pro
- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippTasks/pstamp.pro (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/ippTasks/pstamp.pro
r25059 r27840 1 2 #$VERBOSE = 3 1 # pstamp.pro : Postage Stamp Server tasks 2 3 check.globals 4 5 $LOGSUBDIR = $LOGDIR/pstamp 6 mkdir $LOGSUBDIR 3 7 4 8 # these variables wil cycle through the known database names … … 8 12 $pstampJob_DB = 0 9 13 $pstampFin_DB = 0 14 $pstampRev_DB = 0 15 $pstampDep_DB = 0 10 16 11 17 # set PS_DBSERVER if postage stamp database host is not the same as the value for DBSERVER in site.config 12 # warning: no quotes around the two words. it cause itto get passed to pstamptool as one word13 # tricky to debug problem ensues18 # warning: no quotes around the two words. That causes the variable to get passed to pstamptool as one word 19 # and a tricky to debug problem ensues 14 20 # example: 15 # $PSDBSERVER = -dbserver hostname 16 if ($?PSDBSERVER == 0) 21 # $PS_DBSERVER = -dbserver hostname 22 23 if ($?PS_DBSERVER == 0) 17 24 $PS_DBSERVER = "" 18 25 end … … 22 29 book init pstampJob 23 30 book init pstampFinish 31 book init pstampDependent 24 32 end 25 33 26 34 pstamp.reset 27 28 35 29 36 macro pstamp.on … … 51 58 active true 52 59 end 53 end 60 task pstamp.job.revert 61 active true 62 end 63 task pstamp.dependent.load 64 active true 65 end 66 end 67 54 68 55 69 macro pstamp.off … … 76 90 active false 77 91 end 92 task pstamp.job.revert 93 active false 94 end 95 task pstamp.dependent.load 96 active true 97 end 98 end 99 100 macro pstamp.revert.on 101 task pstamp.job.revert 102 active true 103 end 104 end 105 macro pstamp.revert.off 106 task pstamp.job.revert 107 active false 108 end 78 109 end 79 110 … … 83 114 periods -poll $LOADPOLL 84 115 periods -exec 10 85 periods -timeout 30116 periods -timeout 120 86 117 npending 1 87 118 88 119 task.exec 120 stdout NULL 121 stderr $LOGSUBDIR/pstamp.request.find.log 89 122 if ($DB:n == 0) 90 123 option DEFAULT … … 124 157 125 158 task.exec 159 stdout $LOGSUBDIR/pstamp.request.load.log 160 stderr $LOGSUBDIR/pstamp.request.load.log 126 161 $run = pstamptool -pendingreq 127 162 if ($DB:n == 0) … … 134 169 end 135 170 add_poll_args run 171 add_poll_labels run 136 172 command $run 137 173 end … … 166 202 167 203 task.exec 204 stdout $LOGSUBDIR/pstamp.request.run.log 205 stderr $LOGSUBDIR/pstamp.request.run.log 168 206 book npages pstampRequest -var N 169 207 if ($N == 0) break … … 177 215 book getword pstampRequest $pageName uri -var URI 178 216 book getword pstampRequest $pageName ds_outProduct -var PRODUCT 217 book getword pstampRequest $pageName label -var LABEL 179 218 180 219 host anyhost 181 220 182 $run = pstamp_parser_run.pl --req_id $REQ_ID --uri $URI --product $PRODUCT -- redirect-output221 $run = pstamp_parser_run.pl --req_id $REQ_ID --uri $URI --product $PRODUCT --label $LABEL --redirect-output 183 222 184 223 add_standard_args run … … 221 260 222 261 task.exec 262 stdout $LOGSUBDIR/pstamp.finish.load.log 263 stderr $LOGSUBDIR/pstamp.finish.load.log 264 $run = pstamptool -completedreq 223 265 if ($DB:n == 0) 224 266 option DEFAULT 225 command pstamptool -completedreq226 267 else 227 268 option $DB:$pstampFin_DB 228 command pstamptool -completedreq-dbname $DB:$pstampFin_DB $PS_DBSERVER269 $run = $run -dbname $DB:$pstampFin_DB $PS_DBSERVER 229 270 $pstampFin_DB ++ 230 271 if ($pstampFin_DB >= $DB:n) set pstampFin_DB = 0 231 272 end 273 add_poll_args run 274 add_poll_labels run 275 command $run 232 276 end 233 277 … … 257 301 periods -poll $RUNPOLL 258 302 periods -exec $RUNEXEC 259 periods -timeout 300 260 261 task.exec 303 periods -timeout 2400 304 host anyhost 305 306 task.exec 307 stdout $LOGSUBDIR/request.finish.run.log 308 stderr $LOGSUBDIR/request.finish.run.log 262 309 book npages pstampFinish -var N 263 310 if ($N == 0) break … … 315 362 316 363 task.exec 364 stdout $LOGSUBDIR/pstamp.job.load.log 365 stderr $LOGSUBDIR/pstamp.job.load.log 366 $run = pstamptool -pendingjob 317 367 if ($DB:n == 0) 318 368 option DEFAULT 319 command pstamptool -pendingjob -limit 10320 369 else 321 370 option $DB:$pstampJob_DB 322 command pstamptool -pendingjob -limit 10-dbname $DB:$pstampJob_DB $PS_DBSERVER371 $run = $run -dbname $DB:$pstampJob_DB $PS_DBSERVER 323 372 $pstampJob_DB ++ 324 373 if ($pstampJob_DB >= $DB:n) set pstampJob_DB = 0 325 374 end 375 add_poll_args run 376 add_poll_labels run 377 command $run 326 378 end 327 379 … … 338 390 end 339 391 392 task.exit crash 393 showcommand crash 394 end 395 396 task.exit timeout 397 showcommand timeout 398 end 399 340 400 task.exit default 341 401 showcommand failure 342 402 end 343 403 344 task.exit crash345 showcommand crash346 end347 348 task.exit timeout349 showcommand timeout350 end351 404 end 352 405 … … 357 410 358 411 task.exec 412 stdout $LOGSUBDIR/pstamp.job.run.log 413 stderr $LOGSUBDIR/pstamp.job.run.log 359 414 book npages pstampJob -var N 360 if ($N == 0) break 415 if ($N == 0) 416 periods -exec $RUNEXEC 417 break 418 end 419 periods -exec 0.05 361 420 362 421 book getpage pstampJob 0 -var pageName -key pantaskState INIT … … 371 430 book getword pstampJob $pageName dbname -var DBNAME 372 431 book getword pstampJob $pageName outputBase -var OUTPUT_BASE 432 book getword pstampJob $pageName options -var OPTIONS 373 433 374 434 if ($VERBOSE > 1) … … 378 438 host anyhost 379 439 380 $run = pstamp_job_run.pl --job_id $JOB_ID --job_type $JOB_TYPE --rownum $ROWNUM --output_base $OUTPUT_BASE -- redirect-output440 $run = pstamp_job_run.pl --job_id $JOB_ID --job_type $JOB_TYPE --rownum $ROWNUM --output_base $OUTPUT_BASE --options $OPTIONS --redirect-output 381 441 add_standard_args run 382 442 … … 418 478 end 419 479 end 480 481 task pstamp.job.revert 482 host local 483 484 periods -poll $LOADPOLL 485 periods -exec 300 486 periods -timeout 300 487 npending 1 488 489 task.exec 490 stdout $LOGSUBDIR/pstamp.job.revert.log 491 stderr $LOGSUBDIR/pstamp.job.revert.log 492 $run = pstamptool -revertjob -all 493 if ($DB:n == 0) 494 option DEFAULT 495 else 496 $run = $run $PS_DBSERVER -dbname $DB:$pstampRev_DB 497 $pstampRev_DB ++ 498 if ($pstampRev_DB >= $DB:n) set pstampRev_DB = 0 499 end 500 add_poll_args run 501 add_poll_labels run 502 command $run 503 end 504 505 task.exit $EXIT_SUCCESS 506 # nothing to do 507 end 508 509 task.exit default 510 showcommand failure 511 end 512 513 task.exit crash 514 showcommand crash 515 end 516 517 task.exit timeout 518 showcommand timeout 519 end 520 end 521 522 task pstamp.dependent.load 523 host local 524 525 periods -poll $LOADPOLL 526 # XXX: create a macro for this time 527 periods -exec 10 528 # periods -exec $LOADEXEC 529 periods -timeout 300 530 npending 1 531 532 task.exec 533 stdout $LOGSUBDIR/pstamp.dependent.load.log 534 stderr $LOGSUBDIR/pstamp.dependent.load.log 535 $run = pstamptool -pendingdependent 536 if ($DB:n == 0) 537 option DEFAULT 538 else 539 option $DB:$pstampDep_DB 540 $run = $run -dbname $DB:$pstampDep_DB $PS_DBSERVER 541 $pstampDep_DB ++ 542 if ($pstampDep_DB >= $DB:n) set pstampDep_DB = 0 543 end 544 add_poll_args run 545 add_poll_labels run 546 command $run 547 end 548 549 task.exit $EXIT_SUCCESS 550 ipptool2book stdout pstampDependent -key dep_id -uniq -setword dbname $options:0 -setword pantaskState INIT 551 552 book npages pstampDependent -var N 553 if ($VERBOSE > 2) 554 book listbook pstampDependent 555 end 556 557 # delete existing entries in the appropriate pantaskStates 558 process_cleanup pstampDependent 559 end 560 561 task.exit crash 562 showcommand crash 563 end 564 565 task.exit timeout 566 showcommand timeout 567 end 568 569 task.exit default 570 showcommand failure 571 end 572 573 end 574 575 task pstamp.dependent.run 576 periods -poll $RUNPOLL 577 periods -exec $RUNEXEC 578 periods -timeout 300 579 580 task.exec 581 # stdout $LOGSUBDIR/pstamp.dependent.run.log 582 # stderr $LOGSUBDIR/pstamp.dependent.run.log 583 book npages pstampDependent -var N 584 if ($N == 0) 585 periods -exec $RUNEXEC 586 break 587 end 588 periods -exec 0.05 589 590 book getpage pstampDependent 0 -var pageName -key pantaskState INIT 591 if ("$pageName" == "NULL") break 592 593 #echo pageName: $pageName 594 595 book setword pstampDependent $pageName pantaskState RUN 596 book getword pstampDependent $pageName dep_id -var DEP_ID 597 book getword pstampDependent $pageName state -var STATE 598 book getword pstampDependent $pageName stage -var STAGE 599 book getword pstampDependent $pageName stage_id -var STAGE_ID 600 book getword pstampDependent $pageName component -var COMPONENT 601 book getword pstampDependent $pageName imagedb -var IMAGEDB 602 book getword pstampDependent $pageName rlabel -var RLABEL 603 # book getword pstampDependent $pageName output_base -var OUTPUT_BASE 604 book getword pstampDependent $pageName need_magic -var NEED_MAGIC 605 book getword pstampDependent $pageName dbname -var DBNAME 606 607 if ($VERBOSE > 1) 608 book listpage pstampDependent $pageName 609 end 610 611 host anyhost 612 613 if ("$NEED_MAGIC" == "T") 614 $NEED_MAGIC="--need_magic" 615 else 616 $NEED_MAGIC="" 617 end 618 619 # XXX: use OUTPUT_BASE for this 620 $LOGFILE = /data/ipp053.0/home/bills/pstamp/logs/pstampdep.$DEP_ID.log 621 # echo logfile is $LOGFILE 622 # stdout $LOGFILE 623 # stderr $LOGFILE 624 625 $run = pstamp_checkdependent.pl --dep_id $DEP_ID --stage_id $STAGE_ID --stage $STAGE --component $COMPONENT --imagedb $IMAGEDB --rlabel $RLABEL $NEED_MAGIC 626 add_standard_args run 627 628 options $pageName 629 630 if ($VERBOSE > 1) 631 echo command $run 632 end 633 command $run 634 end 635 636 637 task.exit $EXIT_SUCCESS 638 if ($VERBOSE > 1) 639 echo pstamp.dependent.run task.exit $DEP_ID status: $JOB_STATUS 640 end 641 process_exit pstampDependent $options:0 $JOB_STATUS 642 end 643 task.exit default 644 if ($VERBOSE > 1) 645 echo pstamp.job.run task.exit $DEP_ID status: $JOB_STATUS 646 end 647 showcommand failure 648 process_exit pstampDependent $options:0 $JOB_STATUS 649 end 650 651 task.exit crash 652 echo pstamp.job.run task.crash $DEP_ID status: $JOB_STATUS 653 process_exit pstampDependent $options:0 $JOB_STATUS 654 showcommand crash 655 book setword pstampDependent $options:0 pantaskState CRASH 656 end 657 658 task.exit timeout 659 echo pstamp.job.run task.timeout $DEP_ID status: $JOB_STATUS 660 process_exit pstampDependent $options:0 $JOB_STATUS 661 showcommand timeout 662 book setword pstampDependent $options:0 pantaskState TIMEOUT 663 end 664 end 665
Note:
See TracChangeset
for help on using the changeset viewer.
