[Twisted-Python] distributed method calls in twisted.sister

Sean Riley sean at ninjaneering.com
Mon Jul 8 10:49:53 MDT 2002


background:

twisted.sister is a piece of clustering infrastructure to allow a single
application or simulation to be distributed across multiple servers on
multiple hosts.

twisted.sister has a concept of a "parent" server which acts as a central
locking facility for objects distributed on any number of "sister" servers
in the network.

security in distributed sister servers:

example use case: player1 logged into on one sister server wishes to send a
text message to player2 logged into another - unknown - sister server.

I implemented a "callDistributed" on the sister server which looks like:

def callDistributed(self,
	resourceType,
	resourceName,
	methodName,
	*args,
	**kw):

this goes off to the parent which looks up the sister that has the specified
resource locked, then passes the method call off to that sister to actually
be invoked. all results of course being deferred so the result is passed all
the way back to the originating caller.

so player1 would call:
self.service.callDistributed(
	'avatar',
	'player2',
	'chatMsg',
	'hi there')
and player2 would get the chat message. It currently prepends "remote_" to
the method name on the callee's end.

This appears to be inconsistent with the common twisted notion of knowing
"who" is calling a method for security reasons. Maybe there should be
another type of remote method called "distributed_" which takes the
identifying information of the calling distributed object as the first
arguments:

def distributed_chatMsg(self, resourceType, resourceName, message)

where the resourecType and resourceName identify the distributed resource
that invoked the distributed method call. this distributed_ method would
only ever be invoked by remote objects managed in a twisted.sister network.

I thought about adding the location of the distributed caller object also,
but this information probably isnt required as it is known by the parent who
can route any further communication. the location could also change if an
object migrated between sisters which would invalidate any location
information stored on a sister, so not sending it is a better option.

thoughts?





More information about the Twisted-Python mailing list