diff --git a/PILOTVERSION b/PILOTVERSION index fe6e3d7f..b53bc731 100644 --- a/PILOTVERSION +++ b/PILOTVERSION @@ -1 +1 @@ -3.7.4.2 \ No newline at end of file +3.7.5.4 \ No newline at end of file diff --git a/pilot.py b/pilot.py index 915e3c8c..ebd356b3 100755 --- a/pilot.py +++ b/pilot.py @@ -121,13 +121,19 @@ def main() -> int: ) # note: assuming IPv6, fallback in place # check cvmfs if available - if is_cvmfs_available() is True: # ignore None, False is handled in function + is_available = is_cvmfs_available() + if is_available is None: + pass # ignore this case + elif is_available is True: timestamp = get_last_update() if timestamp and timestamp > 0: logger.info('CVMFS has been validated') else: logger.warning('CVMFS is not responding - aborting pilot') return errors.CVMFSISNOTALIVE + else: + logger.warning('CVMFS is not alive - aborting pilot') + return errors.CVMFSISNOTALIVE if not args.rucio_host: args.rucio_host = config.Rucio.host @@ -736,7 +742,7 @@ def get_proper_exit_code() -> (int, int): """ try: exitcode = trace.pilot["error_code"] - except KeyError: + except (KeyError, AttributeError): exitcode = trace logging.debug(f"trace was not a class, trace={trace}") else: diff --git a/pilot/util/constants.py b/pilot/util/constants.py index da65ded0..6053694d 100644 --- a/pilot/util/constants.py +++ b/pilot/util/constants.py @@ -27,8 +27,8 @@ # Pilot version RELEASE = '3' # released number should be fixed at 3 for Pilot 3 VERSION = '7' # version number is '1' for first release, '0' until then, increased for bigger updates -REVISION = '4' # revision number should be reset to '0' for every new version release, increased for small updates -BUILD = '2' # build number should be reset to '1' for every new development cycle +REVISION = '5' # revision number should be reset to '0' for every new version release, increased for small updates +BUILD = '4' # build number should be reset to '1' for every new development cycle SUCCESS = 0 FAILURE = 1 diff --git a/pilot/util/cvmfs.py b/pilot/util/cvmfs.py index a869d528..b2075d42 100644 --- a/pilot/util/cvmfs.py +++ b/pilot/util/cvmfs.py @@ -65,7 +65,19 @@ def is_cvmfs_available() -> bool or None: if get_base_path: mount_point = mount_point.replace('CVMFS_BASE', get_base_path()) if os.path.exists(mount_point): - logger.debug(f'CVMFS is available at {mount_point}') + # verify that the file can be opened + if 'lastUpdate' not in mount_point: # skip directories + logger.info(f'CVMFS is available at {mount_point}') + continue + try: + with open(mount_point, 'r'): + pass + except Exception as exc: + logger.warning(f'failed to open file {mount_point}: {exc}') + found_bad_mount_point = True + break + else: + logger.info(f'CVMFS is available at {mount_point} (and could be opened)') else: logger.warning(f'CVMFS is not available at {mount_point}') found_bad_mount_point = True @@ -103,7 +115,7 @@ def get_last_update() -> int: now = int(time.time()) logger.info(f'last cvmfs update on ' f'{time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(timestamp))} ' - f'{now - timestamp} seconds ago {timestamp}()') + f'{now - timestamp} seconds ago ({timestamp})') else: logger.warning(f'last update file does not exist: {last_update_file}') else: