PYRO - Change Log

<previous | contents | Pyro Manual

## 12. Pyro Change Log

(most recent entries at the end)

Pyro versions before 3.0 can be found in the archive.

### Pyro 3.0

- Major new version! Not compatible with older versions!
- Pyro is now under the MIT software license. This license is much easier and less restrictive than the previous (GNU LGPL). Please read the file "LICENSE"!
- Major speedup, up to twice as fast as before! (Thanks to new threading code) This makes Pyro in multithreaded mode as fast as singlethreaded mode :-)
- Removed last traces of sockets in `core.py`. It only works with the more abstract connection objects.
- Added SSL support (based on a patch by Holger Brückner, thanks!). Requires M2Crypto module.
- Simplified objectID encoding, now uses hexlified guids everywhere. No more converting from/to binary strings.
- Changed threading in protocol.py: Pyro used to hang when bad clients connected but didn't write their full message on the socket. Now Pyro splits off a new thread directly, as soon as it detected a new connection or request.
- Pyro no longer spawns a new thread for each request. Instead, it spawns a single thread for each connection, and hands control to that thread. The thread processes requests sequentially, and dies when the connection closes. This causes a major speedup when processing lots of small requests.
- Fixed some obscure potential socket/threading bugs and made protocol version mismatch handling slightly better.
- Connection denied reasons added to constants.py
- Fixed cpu-bound server in multithreading example
- Implemented XML pickling support using Gnosis_Utils' xml pickle, PYRO_XML_PICKLE config item to select it. Server automatically answers in correct pickle format.
- No longer dumps config twice when program uses both init client and init server.
- Fixed some cyclic references. Object-daemon reference is now a weak reference if available (Python 2.1+). Daemon/tcpserver now appears to clean up nicely.
- Added some extra cleanup methods to nicely close socket connections.
- Authenticated connection validation. You can now require the Pyro client to give a valid authentication ID (password) while connecting. Control this using the improved connection validator. Not used by default, so old code still works without authentication. See the "NS_sec_plugins" example.
- Configurable timeouts on sending and receiving of messages. Due to changed connection procedure, this also works for new connections. So Pyro can now also timeout when a new client just connects and blocks without sending anything (the port is not occupied forever).
- Added a new chapter about security to the manual.
- The Daemon is no longer directly remotely accessible. Instead, there is now a DaemonServant object with a limited interface that is the actual Pyro object and that calls the daemon.
- PyroURI objects have two new methods to directly get a proxy from an URI object: `getProxy` and `getAttrProxy`.
- Proxies can now be 'passivated' if they are not needed for a while (they release their network connection) `proxy._release()`
- Transient server objects can be automatically cleaned up after a specified period of inactivity. `daemon.setTransientsCleanupAge(timeout)` Also added this to the Bank2 example, so have a look there.
- Mobile agents can now import other modules that don't already exist on the server! (But only from within the agent class methods, not from within the defining module scope) They will also be loaded from the client, if the codeValidator allows this.
- Special base class for callback objects; `CallbackObjBase`. It will raise local exceptions also, not only silently passing them back to the server.
- Can now create `PyroURI` instances from PYROLOC: and PYRONAME: uris. The instance will be the actual URI, after performing the lookup. Not very useful actually, because we used to do the equivalent `proxy=Pyro.core.getProxyForURI('PYRONAME://.......')` Now you can also do `proxy=Pyro.core.PyroURI('PYRONAME://.......').getProxy()`
- Added two minimalist examples in the manual, to show how easy Pyro is :-)
- Name Server, Logger and listdir are now thread-safe (oops, they weren't before).
- Event Server no longer requires threads, checks if it is already running, and has new '-i' command line option to specify the required authentication passphrase.
- Name Server checks at startup if it is not already running in the network segment. Unless you use the new '-m' command line option, it refuses to start if another NS is detected.
- Name Server has new '-i' command line option to specify the required authentication passphrase.
- setup.py script can now be run unattended (for automated installs) by editing setup.cfg
- Added stresstest example (stresses the Name Server and the Event Server). Good for stability check.
- Pyro objects can now access Thread Local Storage by calling `self.getLocalStorage()`. This is an empty class to store your stuff into. It has one attribute, `caller`, that is the TCPConnection of the calling object.
- Renamed "Mobile Agent" to "Mobile Object" where appropriate. Mobile Agents are a special kind of Agent, and an Agent is a very special piece of software, and most mobile code that we're talking about isn't an agent.
- Added process ID and thread name info to logging messages.
- Fixed setup script, creation of RPM should now work (python setup.py bdist_rpm).
- Added "circle" example to show circular calling patterns.
- Added "quickstart-noNS" example, like the "quickstart" example but this one doesn't use the NS.
- Improved "callback" example and documentation about Callbacks.
- Promoted `remote.py` and `remote_nons.py` (from the "quickstart[-noNS]" examples) into the Pyro library: there is a new package `Pyro.ext` that contains them. They still have to be documented in this manual though.
- `PyroURI` objects are now correctly hashable, so you can use them as keys in dictionaries. The uniqueness is determined by the string representation of the oject.
- Documented the fact that `MyObject.attribute.subattribute` won't work in some cases, and extended the attributes example a bit.
- Fixed problem with deleting DynamicProxy in case of invalid URI.
- More troubleshooting tips added.
- Documented deadlock with object conversation problem (in Features chapter).
- When mobile code is not enabled, the remote invocation doesn't use the import wrapper class (5% speed improvement)
- Fixed shell scripts to allow quoted arguments such as: ns -i "the id string"
- URI parsing is stricter (could get in loop with certain invalid URI strings)

### Pyro 3.1

- Finally fixed the Event Server crash problem with the "stresstest" example; the ES now uses worker threads and Queues per subscriber.
- Two new config items for the ES: `PYRO_ES_QUEUESIZE` and `PYRO_ES_BLOCKQUEUE`.
- Small fix in installation docs about where to put the module files.
- Documented the fact that proxies can be pickled when not connected, and added _release method to NameServerProxy.
- Documented the serious 'local object' issue with nested attribute access, in the Features chapter.
- Support added for PyXML's xml-pickler. Config item `PYRO_XML_PICKLE` changed: now chooses what implementation is wanted.
- Docs now contain links where referred to other parts of the docs. Various other documentation fixes.
- ns script now has '-v' option to enable verbose output. Normal output is slightly more compact.
- Proxy objects are now automatically pickleable, no need to call `_release()` first.
- New `SynchronizedObjBase` base class which provides threadsafe method calls (every method call is synchronized on the object).
- Fixes for `CallbackObjBase` error reporting, added another callback example for this.
- `CallbackObjBase` is better documented.

### Pyro 3.2

- Big improvements in the mobile code department, thanks to Ulrich Eck:
  - 2-way mobile code now possible! Client can transparantly download missing code from the server, no longer only upload it to the server!
  - CodeValidators now work for both up- and downloaded code.
  - Remote code downloading from server is also recursive. watch out! there are no sanity checks yet.
  - downloaded modules no longer overwrite existing modules
  - Updated the "agent2" shopping example to use 2-way mobile code.
- Big improvements in the connection validation logic, thanks to Luis Caamano and Scott Leerssen: The connection validation logic has been condensed in a single class (`DefaultConnValidator`). It is now much more flexible. By providing a specialized ConnValidator object you can now completely control the logic that Pyro uses on both client-side and server-side to authenticate new client connections. The change is backwards-compatible and the default implementation still uses the md5 hashing of identification phrases for authentication.
- Added a WXPython GUI name server control utility: wxnsc.py, and a batch file wxnsc. Thanks to Jan Finell for this nice GUI tool with a tree view of the namespace.
- Fixed some path issues (mac) in the setup.py script.
- Fixed some Python 2.1 incompatibilities that had crept in (foo in dict instead of foo in dict.keys())
- NS broadcast server now binds on '' on Windows. '<broadcast>' doesn't work on Windows (???)
- Disconnecting objects from a Daemon no longer crashes when no NS is used.
- Scripts changed to pass correct sys.argv arguments to actual Python modules. Ugly '-c' argument removal code is gone.
- Daemon now tests if your hostname is valid and doesn't resolve to the loopback address 127.0.0.1 (which is often invalid). A warning message is logged in that case. NS and ES also print the message on the screen at startup. The test is done in the `validateHostnameAndIP` method of the Daemon.
- Name Server now also accepts non-absolute names and does the expansion itself, if needed. This enables simplified access to the NS trough other means than the default static proxy obtained from the locator. (suggested by Luis P Caamano).
- Replaced to-be-deprecated `apply` with `func(*args)` syntax. Small speed increase too.
- NS no longer logs error when detecting duplicate NS.
- Added Windows NT Services to Pyro (run NS / ES as NT service). Including batch files `nssvc.bat` and `essvc.bat` to install/remove them.
- Added Unix daemons to Pyro (run NS / ES as initd daemon). Including batch files `nsd` and `esd` to run them from init scripts.
- Relocated Event Server chapter in the manual after the Name Server.
- Fixed race condition in dir check in configuration.py
- Fixed race condition in _grimReaper in core.py
- Fixed mobile code load/compile issue on windows. Pyro now supplies .pyo, .pyc, .py in that order. On Windows, Python can't compile downloaded .py files if they have CR LF in them... :-(
- A few Jython compatibility improvements (GUID, config init).
- Fixed maxclient example and ConnectionDeniedError for maxclients.
- Thread Local Storage has been improved (docs + added initTLS in Daemon)

### Pyro 3.3

- The NS tries "<broadcast>" first, this fails on some systems (windows) but it now automatically tries "" next (which should work).
- Pyro now enforces you to initialize it correctly by calling `Pyro.core.initClient()` or `initServer()`. Failure to do so will result in a `PyroError` very soon.
- Name Server now has Paired Mode: run two NS instances that synchronize with eachother. Use for fail-over.
- nsc tools have new options to deal with new NS features (meta info, paired NS).
- Name Server lookups automatically try to use the second NS if the first is unreachable.
- NS proxy automatically tries to find the NS again (or its twin) when the connection has been lost.
- Three new config items for the paired-NS mode: PYRO_NS2_* (see configuration chapter).
- NS ports slightly changed: NS now uses 9090 TCP and 9090 UDP by default (was: 9090 TCP and 9091 UDP). The second -paired- NS uses 9091 TCP and 9091 UDP.
- You can now run clients on read-only systems: `PYRO_STORAGE` is no longer created and checked for access when initializing clients. When you're initializing a server, it is still checked, unless you explicitly disable the check by setting the new optional argument `storageCheck` to zero: `Pyro.core.initServer(storageCheck=0)`.
- More emphasis in the docs on the drawbacks of single-threading mode; you cannot use callbacks (Pyro will freeze)
- Rewrote the Event Server chapter in the manual.
- objects connected using connectPersistent() are no longer removed from the NS when the Daemon is removed.
- Fixed bug in pickling of DynamicProxy (it didn't work in the regular pickle module, and Jython). Also, you can now do this: `proxy.method(proxy)` i.e. pass the active proxy to a methodcall on itself. That didn't work before.
- Passing DynamicProxies no longer cause the socket connection to be disconnected. So on a new method call on the proxy that was passed, it is no longer needed to do a reconnect.
- Detailed tracebacks (with dump of the local variable's values) can now be enabled by setting `PYRO_DETAILED_TRACEBACK` to 1. Contributed by Richard Emslie.
- Pyro now deals correctly with obsoleted string exceptions (raise "blahblah"). (jf Gosset)
- Pyro exceptions now also automatically print their remote traceback info because the `__str__` method has been customized in the `PyroExceptionCapsule`. No longer necessary to use exception handlers and call `getPyroTraceback`. Contributed by jf Gosset. This is turned off by default, turn it on by setting `PYRO_PRINT_REMOTE_TRACEBACK` to 1.
- New-style logging using the `logging` module can be enabled with the use of two new config items `PYRO_STDLOGGING` and `PYRO_STDLOGGING_CFGFILE`. The logging API is unchanged so old code still runs. With an appropriate logging configuration file, it should be possible to log to any destination (handler) that `logging` supports. This further enables clients (with logging!) on a read-only system: just log to syslog or a socket, no need to write logfiles to the local disk.
- "simple" example is now completely standalone instead of using testclient/server.
- Objects in the Name Server can now have user-defined meta information attached to them.
- `nsc` (and the others) can show the meta information.
- documented that the auth challenge string has to be exactly 16 bytes long, and Pyro now checks this.
- New config item PYRO_TCP_LISTEN_BACKLOG that specifies the socket listen backlog size (used to be a measly 5, is now default 200).
- Reordered a bunch of try..finally regarding mutex locking/unlocking. Should better prevent possible deadlocks.
- Added missing `__copy__` method to `DynamicProxyWithAttrs`. (This bug caused the Bank2 example to crash, for instance).
- Added stdin/stdout redirection to NUL for NT service in BasicNTService.py, thanks to David Rushby.

<previous | contents | Pyro Manual