Subversion Repositories DevTools

Rev

Rev 7155 | Rev 7253 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7155 Rev 7176
Line 266... Line 266...
266
    //      Change the run level to IDLE
266
    //      Change the run level to IDLE
267
    //      Discard any reserved version numbers
267
    //      Discard any reserved version numbers
268
    //      Reset the current package being built
268
    //      Reset the current package being built
269
    try
269
    try
270
    {
270
    {
271
      mLogger.error("allowedToProceed changing run level to IDLE for rcon_id {}", mRconId);
271
      mLogger.warn("allowedToProceed changing run level to IDLE for rcon_id {}", mRconId);
272
      mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_IDLE);
272
      mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_IDLE);
273
    }
273
    }
274
    catch(SQLException e)
274
    catch(SQLException e)
275
    {
275
    {
276
      mLogger.warn("allowedToProceed caught SQLException");
276
      mLogger.warn("allowedToProceed caught SQLException");
Line 301... Line 301...
301
                }
301
                }
302
                if ( seqNum != mReleaseSeqNum)
302
                if ( seqNum != mReleaseSeqNum)
303
                {
303
                {
304
                    //  Release Content has been modified
304
                    //  Release Content has been modified
305
                    mReleaseSeqNum = seqNum;
305
                    mReleaseSeqNum = seqNum;
306
                    mLogger.error("allowedToProceed. Release Sequence changed");
306
                    mLogger.warn("allowedToProceed. Release Sequence changed");
307
                    break;
307
                    break;
308
                }
308
                }
309
                
309
                
310
                //  Check daemon instructions that need to be processed
310
                //  Check daemon instructions that need to be processed
311
                //
311
                //
312
                DaemonInstruction di = new DaemonInstruction(mRtagId, -1, true);
312
                DaemonInstruction di = new DaemonInstruction(mRtagId, -1, true);
313
                if ( mReleaseManager.getDaemonInst( di ) )
313
                if ( mReleaseManager.getDaemonInst( di ) )
314
                {
314
                {
315
                    // At least one daemon instruction has expired
315
                    // At least one daemon instruction has expired
316
                    mLogger.error("allowedToProceed. Deamon instruction to be scheduled");
316
                    mLogger.warn("allowedToProceed. Deamon instruction to be scheduled");
317
                    break;
317
                    break;
318
                }
318
                }
319
                
319
                
320
                //
320
                //
321
                //    Backup plan
321
                //    Backup plan
322
                //    Force a planning session every 60 minutes
322
                //    Force a planning session every 60 minutes
323
                //
323
                //
324
                if ( System.currentTimeMillis() - startMasterWait > 60 * 60 * 1000)
324
                if ( System.currentTimeMillis() - startMasterWait > 60 * 60 * 1000)
325
                {
325
                {
326
                    mLogger.error("allowedToProceed. Force periodic plan");
326
                    mLogger.warn("allowedToProceed. Force periodic plan");
327
                    break;
327
                    break;
328
                }
328
                }
329
                
329
                
330
                //  Have no reason to suspect that we need to plan a release
330
                //  Have no reason to suspect that we need to plan a release
331
                //  Persist idle state to indicate the master is polling
331
                //  Persist idle state to indicate the master is polling
Line 361... Line 361...
361
    boolean proceed = false;
361
    boolean proceed = false;
362
    try
362
    try
363
    {
363
    {
364
      while ( !proceed &&  !BuildDaemon.mShutDown )
364
      while ( !proceed &&  !BuildDaemon.mShutDown )
365
      {
365
      {
366
        mLogger.error("allowedToProceed calling mReleaseManager.connect");                      
366
        mLogger.warn("allowedToProceed calling mReleaseManager.connect");                      
367
        mReleaseManager.connect();
367
        mReleaseManager.connect();
368
        
368
        
369
        //  Ensure that the machine is a part of the current build set
369
        //  Ensure that the machine is a part of the current build set
370
        mLogger.error("allowedToProceed calling mReleaseManager.queryReleaseConfig");                      
370
        mLogger.warn("allowedToProceed calling mReleaseManager.queryReleaseConfig");                      
371
        if ( !mReleaseManager.queryReleaseConfig(mRtagId, mRconId, BuildDaemon.mHostname, getMode(), mStartTime) )
371
        if ( !mReleaseManager.queryReleaseConfig(mRtagId, mRconId, BuildDaemon.mHostname, getMode(), mStartTime) )
372
        {
372
        {
373
            mLogger.warn("allowedToProceed queryReleaseConfig failed");
373
            mLogger.warn("allowedToProceed queryReleaseConfig failed");
374
            mReleaseManager.disconnect();
374
            mReleaseManager.disconnect();
375
            throw new ExitException();
375
            throw new ExitException();
Line 395... Line 395...
395
          throw new ExitException();
395
          throw new ExitException();
396
        }
396
        }
397
        
397
        
398
        //  Check for scheduled downtime or indefinite pause
398
        //  Check for scheduled downtime or indefinite pause
399
        MutableDate resumeTime = new MutableDate();
399
        MutableDate resumeTime = new MutableDate();
400
        mLogger.error("allowedToProceed calling mReleaseManager.queryRunLevelSchedule");                      
400
        mLogger.warn("allowedToProceed calling mReleaseManager.queryRunLevelSchedule");                      
401
        if ( !mReleaseManager.queryRunLevelSchedule(resumeTime) )
401
        if ( !mReleaseManager.queryRunLevelSchedule(resumeTime) )
402
        {
402
        {
403
          mLogger.info("allowedToProceed scheduled downtime");
403
          mLogger.info("allowedToProceed scheduled downtime");
404
          mReleaseManager.disconnect();
404
          mReleaseManager.disconnect();
405
 
405
 
406
          mLogger.error("allowedToProceed changing run level to PAUSED for rcon_id {}", mRconId);
406
          mLogger.warn("allowedToProceed changing run level to PAUSED for rcon_id {}", mRconId);
407
          mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_PAUSED);
407
          mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_PAUSED);
408
          
408
          
409
          //
409
          //
410
          //    Limit the pause to 10 minutes at a time
410
          //    Limit the pause to 10 minutes at a time
411
          //    Allows early get out for the daemons
411
          //    Allows early get out for the daemons
Line 455... Line 455...
455
        else
455
        else
456
        {
456
        {
457
            //
457
            //
458
            //  If commanded to pause, then wait around until the command has been removed.
458
            //  If commanded to pause, then wait around until the command has been removed.
459
            //
459
            //
460
            mLogger.error("allowedToProceed calling mReleaseManager.queryDirectedRunLevel");                      
460
            mLogger.warn("allowedToProceed calling mReleaseManager.queryDirectedRunLevel");                      
461
            if ( !mReleaseManager.queryDirectedRunLevel(mRconId) && !BuildDaemon.mShutDown )
461
            if ( !mReleaseManager.queryDirectedRunLevel(mRconId) && !BuildDaemon.mShutDown )
462
            {
462
            {
463
                mLogger.error("allowedToProceed changing run level to PAUSED for rcon_id {}", mRconId);
463
                mLogger.warn("allowedToProceed changing run level to PAUSED for rcon_id {}", mRconId);
464
                mReleaseManager.disconnect();
464
                mReleaseManager.disconnect();
465
                mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_PAUSED);
465
                mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_PAUSED);
466
 
466
 
467
                //  Sleep for periodicMs
467
                //  Sleep for periodicMs
468
                mLogger.warn("allowedToProceed sleep 1 mins directed downtime");
468
                mLogger.warn("allowedToProceed sleep 1 mins directed downtime");
Line 480... Line 480...
480
    finally
480
    finally
481
    {
481
    {
482
      // this block is executed regardless of what happens in the try block
482
      // this block is executed regardless of what happens in the try block
483
      // even if an exception is thrown
483
      // even if an exception is thrown
484
      // ensure disconnect
484
      // ensure disconnect
485
      mLogger.error("allowedToProceed calling mReleaseManager.disconnect");                      
485
      mLogger.warn("allowedToProceed calling mReleaseManager.disconnect");                      
486
      mReleaseManager.disconnect();
486
      mReleaseManager.disconnect();
487
    }
487
    }
488
    
488
    
489
    if (BuildDaemon.mShutDown)
489
    if (BuildDaemon.mShutDown)
490
    {
490
    {
Line 586... Line 586...
586
          mLogger.info("checkEnvironment sleep returned");
586
          mLogger.info("checkEnvironment sleep returned");
587
        }
587
        }
588
      }
588
      }
589
    }
589
    }
590
 
590
 
591
    mLogger.error("checkEnvironment changing run level to ACTIVE for rcon_id {}", mRconId);
591
    mLogger.warn("checkEnvironment changing run level to ACTIVE for rcon_id {}", mRconId);
592
    mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_ACTIVE);
592
    mRunLevel.persist(mReleaseManager, mRconId, BuildState.DB_ACTIVE);
593
    
593
    
594
    return waitPerformed;
594
    return waitPerformed;
595
  }
595
  }
596
 
596
 
Line 651... Line 651...
651
        if ( file.isDirectory() && !name.startsWith( "." ) )
651
        if ( file.isDirectory() && !name.startsWith( "." ) )
652
        {
652
        {
653
          retVal = true;
653
          retVal = true;
654
        }
654
        }
655
        
655
        
656
        mLogger.info("accept returned {}", retVal);
656
        mLogger.debug("accept returned {}", retVal);
657
        return retVal;
657
        return retVal;
658
      }
658
      }
659
    };
659
    };
660
    
660
    
661
    try
661
    try
Line 726... Line 726...
726
      // this can be thrown by createNewFile
726
      // this can be thrown by createNewFile
727
      retVal = false;
727
      retVal = false;
728
      mLogger.warn("touch caught IOException");
728
      mLogger.warn("touch caught IOException");
729
    }
729
    }
730
    
730
    
731
    mLogger.info("touch returned {}", retVal);
731
    mLogger.debug("touch returned {}", retVal);
732
    return retVal;
732
    return retVal;
733
  }
733
  }
734
  
734
  
735
  /**returns true if free disk space > 5G
735
  /**returns true if free disk space > 5G
736
   * this may become configurable if the need arises
736
   * this may become configurable if the need arises
Line 785... Line 785...
785
      if ( name.compareTo(".") != 0 && ( name.compareTo("..") != 0 ) )
785
      if ( name.compareTo(".") != 0 && ( name.compareTo("..") != 0 ) )
786
      {
786
      {
787
        retVal = true;
787
        retVal = true;
788
      }
788
      }
789
      
789
      
790
      mLogger.info("accept returned {}", retVal);
790
      mLogger.debug("accept returned {}", retVal);
791
      return retVal;
791
      return retVal;
792
    }
792
    }
793
  };
793
  };
794
 
794
 
795
  
795
  
Line 992... Line 992...
992
              //
992
              //
993
              //  Log the abt_daemon value so that we can trace the build log
993
              //  Log the abt_daemon value so that we can trace the build log
994
              //  Build logs from all machines are stored with this number
994
              //  Build logs from all machines are stored with this number
995
              //  Only do it at the start of the build
995
              //  Only do it at the start of the build
996
 
996
 
997
              mLogger.error("BuildRef: {}", mReporting.buildRef );    
997
              mLogger.warn("BuildRef: {}", mReporting.buildRef );    
998
 
998
 
999
          }
999
          }
1000
      }
1000
      }
1001
  }
1001
  }
1002
  
1002