From 2997baa7cbda39cadd1231822799e6e387a98e5d Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 28 Nov 2022 22:06:31 +0000 Subject: [PATCH] better recovery from i/o errors --- copyparty/httpcli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 182a9f50..8cb63ba6 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -1707,12 +1707,16 @@ class HttpCli(object): ofs += len(buf) self.log("clone {} done".format(cstart[0])) - finally: + if not fpool: f.close() else: with self.mutex: self.u2fh.put(path, f) + except: + # maybe busted handle (eg. disk went full) + f.close() + raise finally: x = self.conn.hsrv.broker.ask("up2k.release_chunk", ptop, wark, chash) x.get() # block client until released