--- swift-recon-cron-orig 2015-09-21 16:28:46.373206934 -0700 +++ swift-recon-cron 2015-09-17 15:58:19.470927286 -0700 @@ -29,18 +29,22 @@ async_count = 0 for i in os.listdir(device_dir): device = os.path.join(device_dir, i) - for asyncdir in os.listdir(device): - # skip stuff like "accounts", "containers", etc. - if not (asyncdir == ASYNCDIR_BASE or - asyncdir.startswith(ASYNCDIR_BASE + '-')): - continue - async_pending = os.path.join(device, asyncdir) + try: + for asyncdir in os.listdir(device): + # skip stuff like "accounts", "containers", etc. + if not (asyncdir == ASYNCDIR_BASE or + asyncdir.startswith(ASYNCDIR_BASE + '-')): + continue + async_pending = os.path.join(device, asyncdir) - if os.path.isdir(async_pending): - for entry in os.listdir(async_pending): - if os.path.isdir(os.path.join(async_pending, entry)): - async_hdir = os.path.join(async_pending, entry) - async_count += len(os.listdir(async_hdir)) + if os.path.isdir(async_pending): + for entry in os.listdir(async_pending): + if os.path.isdir(os.path.join(async_pending, entry)): + async_hdir = os.path.join(async_pending, entry) + async_count += len(os.listdir(async_hdir)) + except OSError as e: + logger.critical(str(e)) + continue return async_count