Commit 83f5ccce authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Use a safe value for timeout

parent ecaf92e4
diff -uNr ceph-15.2.4/src/pybind/ceph_argparse.py ceph-15.2.4-fix_ceph_thread_timeout/src/pybind/ceph_argparse.py
--- ceph-15.2.4/src/pybind/ceph_argparse.py 2020-07-01 01:10:51.000000000 +0930
+++ ceph-15.2.4-fix_ceph_thread_timeout/src/pybind/ceph_argparse.py 2020-11-18 18:57:39.711443174 +1030
@@ -1317,9 +1317,8 @@
+++ ceph-15.2.4-fix_ceph_thread_timeout/src/pybind/ceph_argparse.py 2020-12-27 14:15:28.161241445 +1030
@@ -1317,9 +1317,11 @@
if timeout == 0 or timeout == None:
# python threading module will just get blocked if timeout is `None`,
# otherwise it will keep polling until timeout or thread stops.
- # wait for INT32_MAX, as python 3.6.8 use int32_t to present the
- # timeout in integer when converting it to nanoseconds
- timeout = (1 << (32 - 1)) - 1
+ # wait for 5 seconds, as python 3.6.8 use float to present the timeout
+ timeout = 5.0
+ # timeout in integer when converting it to nanoseconds, but since
+ # python3 uses `int64_t` for the deadline before timeout expires,
+ # we have to use a safe value which does not overflow after being
+ # added to current time in microseconds.
+ timeout = 24 * 60 * 60
t = RadosThread(func, *args, **kwargs)
# allow the main thread to exit (presumably, avoid a join() on this
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment