Skip to content

RPC interoperability with non-Python clients #425

@cloud-rocket

Description

@cloud-rocket

Adding this issue to properly document the PR:

To make the RPC communication work properly with non-Python libraries, the serialization should be done with JSON (or another non-Python proprietary) and not with Python Pickle.

The existing JsonRPC serializer is having the following issues:

  • It's not working with Python 3+
  • The exceptions are not properly unserialized.
  • JsonRPC exception serializer does not include Python module which is important for dynamic class creation

The fix to both of those issues is available here - #418

Exception object serialization is especially challenging, since they need to be recreated dynamically when the class is known or not known on the client size.

  • When the class is registered (i.e. standard Python exceptions, asserts) it is handled with pydoc.locate standard function.
  • When the class is custom (i.e. custom derivative of Exception which is not registered on client side. The dynamic creation is done with type construction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions