summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-09-10 17:05:10 +0200
committerbst-marge-bot <marge-bot@buildstream.build>2019-09-10 16:09:14 +0000
commit505316c6c27478711a0cc68edb5407dce0a81e8e (patch)
treed114452d59bb939f8a2dfe4fb2d7449331899c96
parent8261dfa594bf0554be85e4ce6732cd9fe4ff3d44 (diff)
downloadbuildstream-505316c6c27478711a0cc68edb5407dce0a81e8e.tar.gz
cascache.py: Fix cache usage monitor on Python older than 3.7
Older Python versions don't support the typecode 'q', see https://bugs.python.org/issue19896 Fixes #1131.
-rw-r--r--src/buildstream/_cas/cascache.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buildstream/_cas/cascache.py b/src/buildstream/_cas/cascache.py
index 2d93f0527..1f687669b 100644
--- a/src/buildstream/_cas/cascache.py
+++ b/src/buildstream/_cas/cascache.py
@@ -22,6 +22,7 @@ import os
import stat
import errno
import contextlib
+import ctypes
import multiprocessing
import shutil
import signal
@@ -931,8 +932,8 @@ class _CASCacheUsageMonitor:
self.cas = cas
# Shared memory (64-bit signed integer) for current disk usage and quota
- self._disk_usage = multiprocessing.Value('q', -1)
- self._disk_quota = multiprocessing.Value('q', -1)
+ self._disk_usage = multiprocessing.Value(ctypes.c_longlong, -1)
+ self._disk_quota = multiprocessing.Value(ctypes.c_longlong, -1)
# multiprocessing.Process will fork without exec on Unix.
# This can't be allowed with background threads or open gRPC channels.