commit python-rpyc for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-rpyc for openSUSE:Factory checked in at 2024-01-03 12:24:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-rpyc (Old) and /work/SRC/openSUSE:Factory/.python-rpyc.new.28375 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-rpyc" Wed Jan 3 12:24:07 2024 rev:13 rq:1135621 version:5.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-rpyc/python-rpyc.changes 2023-02-28 12:49:43.772868522 +0100 +++ /work/SRC/openSUSE:Factory/.python-rpyc.new.28375/python-rpyc.changes 2024-01-03 12:24:13.041787825 +0100 @@ -1,0 +2,11 @@ +Fri Dec 29 09:53:28 UTC 2023 - Dirk Müller <dmueller@suse.com> + +- update to 5.3.1: + * `#527`_ Resolved timeout issue that was introduced in 5.2.1 + * `#525`_ and `#524`_ Fixed experimental thread binding struct + for platforms where unsigned long is 8-bits + While the fix for thread binding is not backwards compatible, + it only impacts people using an experimental feature. Hence, + I did a patch version bump. + +------------------------------------------------------------------- Old: ---- 5.3.0.tar.gz New: ---- 5.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-rpyc.spec ++++++ --- /var/tmp/diff_new_pack.Jb2zIt/_old 2024-01-03 12:24:13.681811209 +0100 +++ /var/tmp/diff_new_pack.Jb2zIt/_new 2024-01-03 12:24:13.681811209 +0100 @@ -24,9 +24,9 @@ %define psuffix %{nil} %bcond_with test %endif -%global skip_python2 1 +%{?sle15_python_module_pythons} Name: python-rpyc%{psuffix} -Version: 5.3.0 +Version: 5.3.1 Release: 0 Summary: Remote Python Call (RPyC), a RPC library License: MIT @@ -100,6 +100,6 @@ %python_alternative %{_bindir}/rpyc_classic %python_alternative %{_bindir}/rpyc_registry %{python_sitelib}/rpyc -%{python_sitelib}/rpyc-%{version}*-info +%{python_sitelib}/rpyc-%{version}.dist-info %endif ++++++ 5.3.0.tar.gz -> 5.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpyc-5.3.0/CHANGELOG.rst new/rpyc-5.3.1/CHANGELOG.rst --- old/rpyc-5.3.0/CHANGELOG.rst 2022-11-26 07:09:01.000000000 +0100 +++ new/rpyc-5.3.1/CHANGELOG.rst 2023-02-22 04:42:03.000000000 +0100 @@ -1,3 +1,17 @@ +5.3.1 +===== +Date: 2023-02-21 + +- `#527`_ Resolved timeout issue that was introduced in 5.2.1 +- `#525`_ and `#524`_ Fixed experimental thread binding struct for platforms where unsigned long is 8-bits + + - While the fix for thread binding is not backwards compatible, it only impacts people using an experimental feature. Hence, I did a patch version bump. + +.. _#525: https://github.com/tomerfiliba-org/rpyc/pull/525 +.. _#524: https://github.com/tomerfiliba-org/rpyc/issues/524 +.. _#527: https://github.com/tomerfiliba-org/rpyc/issues/527 + + 5.3.0 ===== Date: 2022-11-25 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpyc-5.3.0/docs/conf.py new/rpyc-5.3.1/docs/conf.py --- old/rpyc-5.3.0/docs/conf.py 2022-11-26 07:09:01.000000000 +0100 +++ new/rpyc-5.3.1/docs/conf.py 2023-02-22 04:42:03.000000000 +0100 @@ -11,7 +11,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. -from rpyc.version import __version__, release_date import sys import os import time @@ -52,6 +51,7 @@ # built documents. # # The short X.Y version. +from rpyc.version import __version__, release_date version = __version__ # The full version, including alpha/beta/rc tags. release = __version__ + "/" + release_date diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpyc-5.3.0/rpyc/core/brine.py new/rpyc-5.3.1/rpyc/core/brine.py --- old/rpyc-5.3.0/rpyc/core/brine.py 2022-11-26 07:09:01.000000000 +0100 +++ new/rpyc-5.3.1/rpyc/core/brine.py 2023-02-22 04:42:03.000000000 +0100 @@ -56,9 +56,13 @@ C16 = Struct("!dd") # Successive floats (complex numbers) I1 = Struct("!B") # Python type int w/ size [1] (ctype unsigned char) I4 = Struct("!L") # Python type int w/ size [4] (ctype unsigned long) -# I4I4 is successive ints w/ size 4 and was introduced to pack local thread id and remote thread id -# Since PyThread_get_thread_ident returns a type of unsigned long, !LL can store both thread IDs. -I4I4 = Struct("!LL") +# I8I8 is successive ints w/ size 8 and was introduced to pack local thread id and remote thread id. Since +# PyThread_get_thread_ident returns a type of unsigned long, a platform dependent size, we +# need 8 bytes of length to support LP64/64-bit platforms. See +# - https://unix.org/whitepapers/64bit.html +# - https://en.wikipedia.org/wiki/Integer_(computer_science)#Long_integer +# TODO: Switch to native_id when 3.7 is EOL b/c PyThread_get_thread_ident is inheritly hosed due to casting. +I8I8 = Struct("!QQ") _dump_registry = {} _load_registry = {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpyc-5.3.0/rpyc/core/protocol.py new/rpyc-5.3.1/rpyc/core/protocol.py --- old/rpyc-5.3.0/rpyc/core/protocol.py 2022-11-26 07:09:01.000000000 +0100 +++ new/rpyc-5.3.1/rpyc/core/protocol.py 2023-02-22 04:42:03.000000000 +0100 @@ -24,6 +24,7 @@ pass +UNBOUND_THREAD_ID = 0 # Used when the message is being sent but the thread is not bound yet. DEFAULT_CONFIG = dict( # ATTRIBUTES allow_safe_attrs=True, @@ -171,7 +172,9 @@ self._send_queue = [] self._local_root = root self._closed = False + # Settings for bind_threads self._bind_threads = self._config['bind_threads'] + self._threads = None if self._bind_threads: self._lock = threading.Lock() self._threads = {} @@ -260,13 +263,13 @@ data = brine.dump((msg, seq, args)) if self._bind_threads: this_thread = self._get_thread() - data = brine.I4I4.pack(this_thread.id, this_thread._remote_thread_id) + data + data = brine.I8I8.pack(this_thread.id, this_thread._remote_thread_id) + data if msg == consts.MSG_REQUEST: this_thread._occupation_count += 1 else: this_thread._occupation_count -= 1 if this_thread._occupation_count == 0: - this_thread._remote_thread_id = 0 + this_thread._remote_thread_id = UNBOUND_THREAD_ID # GC might run while sending data # if so, a BaseNetref.__del__ might be called # BaseNetref.__del__ must call asyncreq, @@ -399,7 +402,7 @@ this_thread = self._get_thread() this_thread._occupation_count -= 1 if this_thread._occupation_count == 0: - this_thread._remote_thread_id = 0 + this_thread._remote_thread_id = UNBOUND_THREAD_ID if msg == consts.MSG_REPLY: obj = self._unbox(args) self._seq_request_callback(msg, seq, False, obj) @@ -429,27 +432,25 @@ else: return False # Assume the receive rlock is acquired and incremented + # We must release once BEFORE dispatch, dispatch any data, and THEN notify all (see issue #527 and #449) try: data = None # Ensure data is initialized data = self._channel.poll(timeout) and self._channel.recv() except Exception as exc: + self._recvlock.release() if isinstance(exc, EOFError): self.close() # sends close async request - self._recvlock.release() - with self._recv_event: - self._recv_event.notify_all() raise - # At this point, the recvlock was acquired once, we must release once before exiting the function - if data: - # Dispatch will unbox, invoke callbacks, etc. - self._dispatch(data) + else: self._recvlock.release() + if data: + self._dispatch(data) # Dispatch will unbox, invoke callbacks, etc. + return True + else: + return False + finally: with self._recv_event: self._recv_event.notify_all() - return True - else: - self._recvlock.release() - return False def _serve_bound(self, timeout, wait_for_lock): """Serves messages like `serve` with the added benefit of making request/reply thread bound. @@ -549,35 +550,34 @@ return False - remote_thread_id, local_thread_id = brine.I4I4.unpack(message[:16]) + remote_thread_id, local_thread_id = brine.I8I8.unpack(message[:16]) message = message[16:] this = False - if local_thread_id == 0: # root request - if this_thread._occupation_count == 0: # this - this = True - - else: # other - new = False - - with self._lock: - for thread in self._thread_pool: - if thread._occupation_count == 0 and not thread._event.is_set(): - thread._deque.append((remote_thread_id, message)) - thread._event.set() - break + if local_thread_id == UNBOUND_THREAD_ID and this_thread._occupation_count != 0: + # Message is not meant for this thread. Use a thread that is not occupied or have the pool create a new one. + # TODO: reusing threads may be problematic if occupation being zero is wrong... + new = False + with self._lock: + for thread in self._thread_pool: + if thread._occupation_count == 0 and not thread._event.is_set(): + thread._deque.append((remote_thread_id, message)) + thread._event.set() + break - else: - new = True + else: + new = True - if new: - self._thread_pool_executor.submit(self._serve_temporary, remote_thread_id, message) + if new: + self._thread_pool_executor.submit(self._serve_temporary, remote_thread_id, message) - elif local_thread_id == this_thread.id: + elif local_thread_id in {UNBOUND_THREAD_ID, this_thread.id}: + # Of course, the message is for this thread if equal. When id is UNBOUND_THREAD_ID, + # we deduce that occupation count is 0 from the previous if condition. So, set this True. this = True - - else: # sub request + else: + # Otherwise, message was meant for another thread. thread = self._get_thread(id=local_thread_id) with self._lock: thread._deque.append((remote_thread_id, message)) @@ -924,7 +924,7 @@ self.id = id - self._remote_thread_id = 0 + self._remote_thread_id = UNBOUND_THREAD_ID self._occupation_count = 0 self._event = threading.Event() self._deque = collections.deque() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpyc-5.3.0/rpyc/version.py new/rpyc-5.3.1/rpyc/version.py --- old/rpyc-5.3.0/rpyc/version.py 2022-11-26 07:09:01.000000000 +0100 +++ new/rpyc-5.3.1/rpyc/version.py 2023-02-22 04:42:03.000000000 +0100 @@ -1,3 +1,3 @@ -__version__ = '5.3.0' +__version__ = '5.3.1' version = tuple(__version__.split('.')) -release_date = "2022-11-25" +release_date = "2023-02-21"
participants (1)
-
Source-Sync