diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2019-08-02 11:21:01 +0200 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2019-09-08 15:58:56 +0100 |
commit | 6894e60b1ead352c27346b608cf4ee86a33f7fff (patch) | |
tree | 93a75147c63f90647a869e807692ed558e768197 | |
parent | 762863e90f3c3277117201cb7488d2bc88b81812 (diff) |
Gracefully cope with coarse system clock
On hppa, we sometimes get a DivisionByZero error - presumably because
the system clock doesn't offer enough granularity.
Gbp-Pq: Name 0005-Gracefully-cope-with-coarse-system-clock.patch
-rw-r--r-- | src/s3ql/fs.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/s3ql/fs.py b/src/s3ql/fs.py index 33c87fd..ce61180 100644 --- a/src/s3ql/fs.py +++ b/src/s3ql/fs.py @@ -409,8 +409,11 @@ class Operations(llfuse.Operations): queue.append(id_p) dt = time.time() - stamp - batch_size = int(batch_size * GIL_RELEASE_INTERVAL / dt) - batch_size = min(batch_size, 200) # somewhat arbitrary... + if dt == 0: + batch_size *= 2 + else: + batch_size = int(batch_size * GIL_RELEASE_INTERVAL / dt) + batch_size = min(batch_size, 200) # somewhat arbitrary... batch_size = max(batch_size, 20000) log.debug('Adjusting batch_size to %d and yielding', batch_size) llfuse.lock.yield_(100) |