RPyC v4.0.0 Release Notes

Release Date: 2018-06-11 // over 3 years ago
  • Date: 11.06.2018

    ๐Ÿš€ This release brings a few minor backward incompatibilities, so be sure to read โฌ†๏ธ on before upgrading. However, fear not: the ones that are most likely relevant to you have a relatively simple migration path.

    Backward Incompatibilities

    • classic.teleport_function now executes the function in the connection's namespace by default. To get the old behaviour, use teleport_function(conn, func, conn.modules[func.__module__].__dict__) instead.

    • Changed signature of Service.on_connect and on_disconnect, adding the connection as argument.

    • Changed signature of Service.__init__, removing the connection argument

    • no longer store connection as self._conn. (allows services that serve multiple clients using the same service object, see #198_).

    • SlaveService is now split into two asymetric classes: SlaveService and MasterService. The slave exposes functionality to the master but can not anymore access remote objects on the master (#232, #248). If you were previously using SlaveService, you may experience problems when feeding the slave with netrefs to objects on the master. In this case, do any of the following:

      • use ClassicService (acts exactly like the old SlaveService)
      • use SlaveService with a config that allows attribute access etc
      • use rpyc.utils.deliver to feed copies rather than netrefs to the slave
    • RegistryServer.on_service_removed is once again called whenever a service instance is removed, making it symmetric to on_service_added (#238) This reverts PR #173 on issue #172_.

    • โœ‚ Removed module rpyc.experimental.splitbrain. It's too confusing and undocumented for me and I won't be developing it, so better remove it altogether. (It's still available in the splitbrain branch)

    • โœ‚ Removed module rpyc.experimental.retunnel. Seemingly unused anywhere, no documentation, no clue what this is about.

    • bin/rpyc_classic.py will bind to instead of by default

    • SlaveService no longer serves exposed attributes (i.e., it now uses allow_exposed_attrs=False)

    • ๐Ÿ”ฆ Exposed attributes no longer hide plain attributes if one otherwise has the required permissions to access the plain attribute. (#165_)

    .. _#165: https://github.com/tomerfiliba/rpyc/issues/165 .. _#172: https://github.com/tomerfiliba/rpyc/issues/172 .. _#173: https://github.com/tomerfiliba/rpyc/issues/173 .. _#198: https://github.com/tomerfiliba/rpyc/issues/198 .. _#232: https://github.com/tomerfiliba/rpyc/issues/232 .. _#238: https://github.com/tomerfiliba/rpyc/issues/238 .. _#248: https://github.com/tomerfiliba/rpyc/issues/248

    What else is new ^

    • 0๏ธโƒฃ teleported functions will now be defined by default in the globals dict

    • Can now explicitly specify globals for teleported functions

    • Can now use streams as context manager

    • keep a hard reference to connection in netrefs, may fix some EOFError issues, in particular on Jython related (#237_)

    • ๐Ÿ”€ handle synchronous and asynchronous requests uniformly

    • ๐Ÿ›  fix deadlock with connections talking to each other multithreadedly (#270_)

    • ๐Ÿ– handle timeouts cumulatively

    • ๐Ÿ›  fix possible performance bug in Win32PipeStream.poll (oversleeping)

    • ๐Ÿ“š use readthedocs theme for documentation (#269_)

    • ๐Ÿ”€ actually time out sync requests (#264_)

    • ๐Ÿ“š clarify documentation concerning exceptions in Connection.ping (#265_)

    • fix __hash__ for netrefs (#267, #268)

    • rename async module to async_ for py37 compatibility (#253_)

    • ๐Ÿ›  fix deliver() from IronPython to CPython2 (#251_)

    • ๐Ÿ›  fix brine string handling in py2 IronPython (#251_)

    • add gevent_ Server. For now, this requires using gevent.monkey.patch_all() before importing for rpyc. Client connections can already be made without further changes to rpyc, just using gevent's monkey patching. (#146_)

    • โž• add function rpyc.lib.spawn to spawn daemon threads

    • ๐Ÿ›  fix several bugs in bin/rpycd.py that crashed this script on startup (#231_)

    • ๐Ÿ›  fix problem with MongoDB, or more generally any remote objects that have a catch-all __getattr__ (#165_)

    • ๐Ÿ›  fix bug when copying remote numpy arrays (#236_)

    • โž• added rpyc.utils.helpers.classpartial to bind arguments to services (#244_)

    • can now pass services optionally as instance or class (could only pass as class, #244_)

    • The service is now charged with setting up the connection, doing so in Service._connect. This allows using custom protocols by e.g. subclassing Connection. More discussions and related features in #239-#247.

    • โšก๏ธ service can now easily override protocol handlers, by updating conn._HANDLERS in _connect or on_connect. For example: conn._HANDLERS[HANDLE_GETATTR] = self._handle_getattr.

    • ๐Ÿ– most protocol handlers (Connection._handle_XXX) now directly get the object rather than its ID as first argument. This makes overriding individual handlers feel much more high-level. And by the way it turns out that this fixes two long-standing issues (#137, #153)

    • ๐Ÿ›  fix bug with proxying context managers (#228_)

    • ๐Ÿ”ฆ expose server classes from rpyc top level module

    • ๐Ÿ›  fix logger issue on jython

    .. _#137: https://github.com/tomerfiliba/rpyc/issues/137 .. _#146: https://github.com/tomerfiliba/rpyc/issues/146 .. _#153: https://github.com/tomerfiliba/rpyc/issues/153 .. _#165: https://github.com/tomerfiliba/rpyc/issues/165 .. _#228: https://github.com/tomerfiliba/rpyc/issues/228 .. _#231: https://github.com/tomerfiliba/rpyc/issues/231 .. _#236: https://github.com/tomerfiliba/rpyc/issues/236 .. _#237: https://github.com/tomerfiliba/rpyc/issues/237 .. _#239: https://github.com/tomerfiliba/rpyc/issues/239 .. _#244: https://github.com/tomerfiliba/rpyc/issues/244 .. _#247: https://github.com/tomerfiliba/rpyc/issues/247 .. _#251: https://github.com/tomerfiliba/rpyc/issues/251 .. _#253: https://github.com/tomerfiliba/rpyc/issues/253 .. _#264: https://github.com/tomerfiliba/rpyc/issues/264 .. _#265: https://github.com/tomerfiliba/rpyc/issues/265 .. _#267: https://github.com/tomerfiliba/rpyc/issues/267 .. _#268: https://github.com/tomerfiliba/rpyc/issues/268 .. _#269: https://github.com/tomerfiliba/rpyc/issues/269 .. _#270: https://github.com/tomerfiliba/rpyc/issues/270

    .. _gevent: http://www.gevent.org/