self.name = name super(GangaThread, self).__init__() def should_stop(self): return False class RepositoryError(Exception): pass logger = getLogger() session_lock_last = 0 session_expiration_timeout = 0 try: session_expiration_timeout = getConfig('Configuration')['DiskIOTimeout'] except ConfigError, err: session_expiratrion_timeout = 5 session_lock_refresher = None last_count_access = [] def getGlobalLockRef(session_name, sdir, gfn, _on_afs): global session_lock_refresher if session_lock_refresher is None: try: os.close(SessionLockManager.delay_init_open(gfn)) registerGlobalSessionFile(gfn) except OSError as err:
super(GangaThread, self).__init__() def should_stop(self): return False class RepositoryError(Exception): pass logger = Ganga.Utility.logging.getLogger() session_lock_last = 0 session_expiration_timeout = 0 try: session_expiration_timeout = getConfig("Configuration")["DiskIOTimeout"] except ConfigError, err: session_expiratrion_timeout = 5 session_lock_refresher = None sessionFiles = [] sessionFileHandlers = [] def registerGlobalSessionFile(thisSessionFile): global sessionFiles if thisSessionFile not in sessionFiles: sessionFiles.append(thisSessionFile)
def should_stop(self): return False class RepositoryError(Exception): pass logger = getLogger() session_lock_last = 0 session_expiration_timeout = 0 try: session_expiration_timeout = getConfig('Configuration')['DiskIOTimeout'] except ConfigError, err: session_expiratrion_timeout = 5 session_lock_refresher = None def getGlobalLockRef(session_name, sdir, gfn, _on_afs): global session_lock_refresher if session_lock_refresher is None: try: os.close(SessionLockManager.delay_init_open(gfn)) registerGlobalSessionFile(gfn) except OSError as err: logger.debug("Startup Lock Refresher Exception: %s" % str(err)) raise RepositoryError(None, "Error on session file '%s' creation: %s" % (gfn, err)) session_lock_refresher = SessionLockRefresher(session_name, sdir, gfn, None, _on_afs)
def _getIOTimeOut(self): from Ganga.Utility.Config.Config import getConfig, ConfigError try: _timeOut = getConfig('Configuration')['DiskIOTimeout'] except ConfigError, err: _timeOut = 5. # 5sec hardcoded default
def getconfig(): """Return the [Robot] section of the global configuration.""" return getConfig('Robot')