Ejemplo n.º 1
0
            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:
Ejemplo n.º 2
0
            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)

Ejemplo n.º 3
0
        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)
Ejemplo n.º 4
0
 def _getIOTimeOut(self):
     from Ganga.Utility.Config.Config import getConfig, ConfigError
     try:
         _timeOut = getConfig('Configuration')['DiskIOTimeout']
     except ConfigError, err:
         _timeOut = 5. # 5sec hardcoded default
Ejemplo n.º 5
0
 def _getIOTimeOut(self):
     from Ganga.Utility.Config.Config import getConfig, ConfigError
     try:
         _timeOut = getConfig('Configuration')['DiskIOTimeout']
     except ConfigError, err:
         _timeOut = 5. # 5sec hardcoded default
Ejemplo n.º 6
0
def getconfig():
    """Return the [Robot] section of the global configuration."""
    return getConfig('Robot')
Ejemplo n.º 7
0
def getconfig():
    """Return the [Robot] section of the global configuration."""
    return getConfig('Robot')