Git Product home page Git Product logo

Comments (4)

comrumino avatar comrumino commented on July 28, 2024

RPyC 5.3.1 seem to work with the currently defined unittests on master for Python 3.12.1, but there are known issues I'm working on the develop branch. Would you be able more details to help reproduce your issue such as provide an example client/server or a failing unittest?

from rpyc.

catchthemonster avatar catchthemonster commented on July 28, 2024

I think that I was doing something wrong. Do to architecture change I was trying to chain service with rpc client to another rpc service thus creating this type of recursion.
I redesigned architecture of app and refactored the code, so honestly I don't think that old code will help. I will in day or two run framework with client in 3.12.1 and let you know.
It would be nice to know if you don't mind what is that you folks are working one in dev ... If I run into this again I will post here ...

from rpyc.

catchthemonster avatar catchthemonster commented on July 28, 2024

Hello,
I am confirming now that something is really deadly wrong with RPyC 5.3.1 and py-3.12.1
let me try to describe how our framework works:
py-3.12.1

main app will instantiate all sub-apps via multiprocessing. rpc threaded server is one of does apps. client in this case is part of another vertical stack FASTAPI (mix of sync and async behaviors) and number of metaclass structures representing one or the other software patterns. All of this is tied up with our code so everything works up to invocation of exposed method on rpc threaded server. rpc get's stuck on the protocol side, recursion error pops out and we fail. Now I tested it with py-3.11 and py-3.10.8. Both of these interpreters do a perfect job and no issues were detected.

@Property

def root(self):  # serving

    """Fetches the root object (service) of the other party"""

    if self._remote_root is None:

        self._remote_root = self.sync_request(consts.HANDLE_GETROOT)

    return self._remote_root



def sync_request(self, handler, *args):

    """requests, sends a synchronous request (waits for the reply to arrive)



    :raises: any exception that the requets may be generated

    :returns: the result of the request

    """

    timeout = self._config["sync_request_timeout"]

    _async_res = self.async_request(handler, *args, timeout=timeout)

    # _async_res is an instance of AsyncResult, the value property invokes Connection.serve via AsyncResult.wait

    # So, the _recvlock can be acquired multiple times by the owning thread and warrants the use of RLock

    return _async_res.value

some of the traceback...

2024-02-07 16:58:37,739 - INFO - 1680823 - server.py:200 server:_serve_client - welcome ('10.197.136.73', 53908)

2024-02-07 16:59:09,841 - DEBUG - 1680823 - protocol.py:366 protocol:_dispatch_request - Exception caught

Traceback (most recent call last):

File "/cube/api/py-3.12.1/lib/python3.12/site-packages/rpyc/core/protocol.py", line 358, in _dispatch_request

args = self._unbox(args)

       ^^^^^^^^^^^^^^^^^

File "/cube/api/py-3.12.1/lib/python3.12/site-packages/rpyc/core/protocol.py", line 324, in _unbox

return tuple(self._unbox(item) for item in value)

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/cube/api/py-3.12.1/lib/python3.12/site-packages/rpyc/core/protocol.py", line 324, in

return tuple(self._unbox(item) for item in value)

             ^^^^^^^^^^^^^^^^^

File "/cube/api/py-3.12.1/lib/python3.12/site-packages/rpyc/core/protocol.py", line 333, in _unbox

proxy = self._netref_factory(id_pack)

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/cube/api/py-3.12.1/lib/python3.12/site-packages/rpyc/core/protocol.py", line 353, in _netref_factory

return cls(self, id_pack)

       ^^^^^^^^^^^^^^^^^^

File "/data1/kacans2/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_pep_669_tracing.py", line 498, in call

frame = self.frame

        ^^^^^^^^^^

File "/data1/kacans2/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_pep_669_tracing.py", line 41, in frame

while frame and isinstance(frame.f_locals.get('self'), PEP669CallbackBase):

                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/cube/api/py-3.12.1/lib/python3.12/site-packages/rpyc/core/netref.py", line 133, in getattribute

cls = object.__getattribute__(self, "__class__")

      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/cube/api/py-3.12.1/lib/python3.12/site-packages/rpyc/core/netref.py", line 291, in get

return self.owner if netref_instance.____id_pack__[2] == 0 else self.instance

                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/cube/api/py-3.12.1/lib/python3.12/site-packages/rpyc/core/netref.py", line 153, in getattr

return syncreq(self, consts.HANDLE_GETATTR, name)

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/cube/api/py-3.12.1/lib/python3.12/site-packages/rpyc/core/netref.py", line 63, in syncreq

return conn.sync_request(handler, proxy, *args)

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/cube/api/py-3.12.1/lib/python3.12/site-packages/rpyc/core/protocol.py", line 715, in sync_request

_async_res = self.async_request(handler, *args, timeout=timeout)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/cube/api/py-3.12.1/lib/python3.12/site-packages/rpyc/core/protocol.py", line 742, in async_request

self._async_request(handler, args, res)

File "/cube/api/py-3.12.1/lib/python3.12/site-packages/rpyc/core/protocol.py", line 724, in _async_request

self._send(consts.MSG_REQUEST, seq, (handler, self._box(args)))

                                              ^^^^^^^^^^^^^^^

Regards,

from rpyc.

catchthemonster avatar catchthemonster commented on July 28, 2024

Hello,
Is there anything else wee can do on this issue...

from rpyc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.