diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2020-02-21 11:24:35 -0400 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2020-02-21 11:24:35 -0400 |
commit | 0643cc2f06f175451439a4bed71478ff6825494a (patch) | |
tree | 5bd12fa067883f92b8b910992bd37b0fcfba5389 /cloud_mdir_sync/main.py | |
parent | 9a04a96eb7f2c2afc544fe6a92132f2968afe3bd (diff) | |
download | cloud_mdir_sync-0643cc2f06f175451439a4bed71478ff6825494a.tar.gz cloud_mdir_sync-0643cc2f06f175451439a4bed71478ff6825494a.tar.bz2 cloud_mdir_sync-0643cc2f06f175451439a4bed71478ff6825494a.zip |
Catch failures from the sha1sum fork
This should trigger a sleep and retry, not a program failure.
It happens if the sha1sum races with the user renaming a MailDir file.
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'cloud_mdir_sync/main.py')
-rw-r--r-- | cloud_mdir_sync/main.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cloud_mdir_sync/main.py b/cloud_mdir_sync/main.py index d810956..d085dda 100644 --- a/cloud_mdir_sync/main.py +++ b/cloud_mdir_sync/main.py @@ -3,6 +3,7 @@ import argparse import asyncio import contextlib import os +import subprocess from typing import Dict, Optional, Tuple import aiohttp @@ -82,7 +83,7 @@ async def synchronize_mail(cfg: config.Config): msgs = nmsgs except (FileNotFoundError, asyncio.TimeoutError, aiohttp.client_exceptions.ClientError, IOError, - RuntimeError): + RuntimeError, subprocess.CalledProcessError): cfg.logger.exception( "Failed update cycle, sleeping then retrying") await asyncio.sleep(10) |