You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(48) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
|
Feb
(45) |
Mar
|
Apr
(6) |
May
(14) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Eric C. N. <eri...@us...> - 2002-05-09 20:51:37
|
Update of /cvsroot/recall/corba/src/Recall In directory usw-pr-cvs1:/tmp/cvs-serv23309/Recall Modified Files: CorbaUtil.py Log Message: doh... elements all come from self Index: CorbaUtil.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/CorbaUtil.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CorbaUtil.py 9 May 2002 20:12:14 -0000 1.13 --- CorbaUtil.py 9 May 2002 20:51:30 -0000 1.14 *************** *** 39,43 **** def run(self): import select ! s = listen(host, port) try: while not self.testStop(): --- 39,43 ---- def run(self): import select ! s = listen(self.host, self.port) try: while not self.testStop(): *************** *** 45,49 **** if rd: c, a = s.accept() ! c.send(ior) c.close() finally: --- 45,49 ---- if rd: c, a = s.accept() ! c.send(self.ior) c.close() finally: |
From: Eric C. N. <eri...@us...> - 2002-05-09 20:12:19
|
Update of /cvsroot/recall/corba/src/Recall In directory usw-pr-cvs1:/tmp/cvs-serv11726 Modified Files: CorbaUtil.py Log Message: cleanups from neal Index: CorbaUtil.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/CorbaUtil.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CorbaUtil.py 9 May 2002 19:01:38 -0000 1.12 --- CorbaUtil.py 9 May 2002 20:12:14 -0000 1.13 *************** *** 16,19 **** --- 16,20 ---- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + s.setblocking(0) bound = None for unused in range(241): # TIME_WAIT may be as long as 240 secs *************** *** 32,45 **** class Publisher(Thread.Thread): ! def __init__(self, *args, **kwargs): Thread.Thread.__init__(self) ! self.args = args def run(self): import select - host, port, ior = self.args - print port s = listen(host, port) - s.setblocking(0) try: while not self.testStop(): --- 33,43 ---- class Publisher(Thread.Thread): ! def __init__(self, host, port, ior, **kwargs): Thread.Thread.__init__(self) ! self.host, self.port, self.ior = host, port, ior def run(self): import select s = listen(host, port) try: while not self.testStop(): *************** *** 50,54 **** c.close() finally: - Log.message('Publisher stopping') s.close() --- 48,51 ---- |
From: Eric C. N. <eri...@us...> - 2002-05-09 19:08:02
|
Update of /cvsroot/recall/corba/src/Demo In directory usw-pr-cvs1:/tmp/cvs-serv22866/src/Demo Modified Files: Client.py simple_test.sh Log Message: make publisher a util, to use in the demo Index: Client.py =================================================================== RCS file: /cvsroot/recall/corba/src/Demo/Client.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Client.py 30 Apr 2002 16:17:35 -0000 1.11 --- Client.py 9 May 2002 19:01:38 -0000 1.12 *************** *** 76,79 **** --- 76,81 ---- self.server = None self.contexts = None + self.publisher = None + self.port = None def nextId(self): *************** *** 122,129 **** --- 124,134 ---- def restart(self): self.server.stop() + self.publisher.stopWait() import glob for file in glob.glob("%s.*"% sys.argv[1]): os.unlink(file) self.server = self.make_echo() + self.publisher = self.contexts.publish('', self.port, self.server) + self.publisher.start() def run_loop(self): *************** *** 132,142 **** def main(self): import string ! port = string.atoi(string.split(sys.argv[1], ':')[3]) import Recall.idl timeout = Recall.idl.MessageSendTimeoutSeconds args = [ "-ORBclientCallTimeOutPeriod", `timeout`, ! "-ORBscanGranularity", `timeout`, ! "-ORBpoa_iiop_port", `port`] self.contexts = CorbaUtil.Contexts(args) --- 137,146 ---- def main(self): import string ! self.port = string.atoi(string.split(sys.argv[1], ':')[1]) import Recall.idl timeout = Recall.idl.MessageSendTimeoutSeconds args = [ "-ORBclientCallTimeOutPeriod", `timeout`, ! "-ORBscanGranularity", `timeout`] self.contexts = CorbaUtil.Contexts(args) *************** *** 153,156 **** --- 157,163 ---- self.contexts.activatePOA() self.client = impl._this() + self.publisher = self.contexts.publish('', self.port, self.server) + self.publisher.start() + if sys.platform == 'win32': self.run_loop() Index: simple_test.sh =================================================================== RCS file: /cvsroot/recall/corba/src/Demo/simple_test.sh,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** simple_test.sh 30 Apr 2002 16:17:48 -0000 1.6 --- simple_test.sh 9 May 2002 19:01:38 -0000 1.7 *************** *** 15,19 **** trap quit 1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 ! BASE=corbaloc::localhost:200 A=${BASE}1 B=${BASE}2 --- 15,19 ---- trap quit 1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 ! BASE=localhost:200 A=${BASE}1 B=${BASE}2 *************** *** 22,29 **** --- 22,32 ---- python Demo/Client.py $A $B $C & PIDS="$PIDS $!" + sleep 1 python Demo/Client.py $B $A $C & PIDS="$PIDS $!" + sleep 1 python Demo/Client.py $C $A $B & PIDS="$PIDS $!" + sleep 1 wait $PIDS |
From: Eric C. N. <eri...@us...> - 2002-05-09 19:08:02
|
Update of /cvsroot/recall/corba/src In directory usw-pr-cvs1:/tmp/cvs-serv22866/src Modified Files: server.py Log Message: make publisher a util, to use in the demo Index: server.py =================================================================== RCS file: /cvsroot/recall/corba/src/server.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** server.py 9 May 2002 14:16:18 -0000 1.18 --- server.py 9 May 2002 19:01:38 -0000 1.19 *************** *** 48,56 **** c.activatePOA() ! c.publish('', port, server) try: c.run() finally: server.stop() --- 48,58 ---- c.activatePOA() ! publisher = c.publish('', port, server) try: + publisher.start() c.run() finally: + publisher.stopWait() server.stop() |
From: Eric C. N. <eri...@us...> - 2002-05-09 19:08:01
|
Update of /cvsroot/recall/corba/src/Recall In directory usw-pr-cvs1:/tmp/cvs-serv22866/src/Recall Modified Files: CorbaUtil.py Log Message: make publisher a util, to use in the demo Index: CorbaUtil.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/CorbaUtil.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CorbaUtil.py 9 May 2002 14:16:19 -0000 1.11 --- CorbaUtil.py 9 May 2002 19:01:38 -0000 1.12 *************** *** 1,4 **** --- 1,6 ---- "CORBA utilities" + from Recall import Thread + import CORBA CosNaming = CORBA.CosNaming *************** *** 28,37 **** raise socket.error('Cannot listen on socket %s:%d' % (host, port)) ! def publisher(host, port, ior): ! s = listen(host, port) ! while 1: ! c, a = s.accept() ! c.send(ior) ! c.close() class Contexts: --- 30,55 ---- raise socket.error('Cannot listen on socket %s:%d' % (host, port)) ! class Publisher(Thread.Thread): ! ! def __init__(self, *args, **kwargs): ! Thread.Thread.__init__(self) ! self.args = args ! ! def run(self): ! import select ! host, port, ior = self.args ! print port ! s = listen(host, port) ! s.setblocking(0) ! try: ! while not self.testStop(): ! rd, wr, ex = select.select([s], [], [], 1.0) ! if rd: ! c, a = s.accept() ! c.send(ior) ! c.close() ! finally: ! Log.message('Publisher stopping') ! s.close() class Contexts: *************** *** 86,92 **** def publish(self, host, port, obj): - import thread ior = self.__orb.object_to_string(obj._this()) ! thread.start_new_thread(publisher, (host, port, ior)) def run(self): --- 104,109 ---- def publish(self, host, port, obj): ior = self.__orb.object_to_string(obj._this()) ! return Publisher(host, port, ior) def run(self): |
From: Eric C. N. <eri...@us...> - 2002-05-09 14:16:22
|
Update of /cvsroot/recall/corba/src/Recall In directory usw-pr-cvs1:/tmp/cvs-serv29776/Recall Modified Files: CorbaUtil.py Log Message: more fixups for publishing IOR on a socket Index: CorbaUtil.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/CorbaUtil.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CorbaUtil.py 7 May 2002 12:46:42 -0000 1.10 --- CorbaUtil.py 9 May 2002 14:16:19 -0000 1.11 *************** *** 10,13 **** --- 10,38 ---- LISTEN_PAUSE = 1.0 + def listen(host, port): + import socket + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + bound = None + for unused in range(241): # TIME_WAIT may be as long as 240 secs + try: + if not bound: + s.bind( (host, port) ) + bound = 1 + s.listen(1) + return s + except socket.error, exc: + Log.error(str(exc)) + import time + time.sleep(1) + raise socket.error('Cannot listen on socket %s:%d' % (host, port)) + + def publisher(host, port, ior): + s = listen(host, port) + while 1: + c, a = s.accept() + c.send(ior) + c.close() + class Contexts: "A class to simplify access to CORBA and contexts" *************** *** 34,40 **** return self.__poa.deactivate_object(self.__poa.servant_to_id(obj)) - def object_to_string(self, obj): - return self.__orb.object_to_string(obj._this()) - def find(self, name): import string --- 59,62 ---- *************** *** 62,65 **** --- 84,92 ---- except AttributeError: self.__poa.the_POAManager().activate() + + def publish(self, host, port, obj): + import thread + ior = self.__orb.object_to_string(obj._this()) + thread.start_new_thread(publisher, (host, port, ior)) def run(self): |
From: Eric C. N. <eri...@us...> - 2002-05-09 14:16:22
|
Update of /cvsroot/recall/corba/src/Av In directory usw-pr-cvs1:/tmp/cvs-serv29776/Av Modified Files: simple_test.sh Log Message: more fixups for publishing IOR on a socket Index: simple_test.sh =================================================================== RCS file: /cvsroot/recall/corba/src/Av/simple_test.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** simple_test.sh 1 May 2002 23:09:01 -0000 1.3 --- simple_test.sh 9 May 2002 14:16:19 -0000 1.4 *************** *** 1,5 **** #! /bin/sh ! BASE=corbaloc::localhost:200 cd .. python server.py Av.Storage ${BASE}1 ${BASE}2 ${BASE}3 & --- 1,5 ---- #! /bin/sh ! BASE=localhost:200 cd .. python server.py Av.Storage ${BASE}1 ${BASE}2 ${BASE}3 & |
From: Eric C. N. <eri...@us...> - 2002-05-09 14:16:21
|
Update of /cvsroot/recall/corba/src In directory usw-pr-cvs1:/tmp/cvs-serv29776 Modified Files: server.py Log Message: more fixups for publishing IOR on a socket Index: server.py =================================================================== RCS file: /cvsroot/recall/corba/src/server.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** server.py 7 May 2002 12:46:41 -0000 1.17 --- server.py 9 May 2002 14:16:18 -0000 1.18 *************** *** 22,49 **** return self.ctor(echo) - def listen(host, port): - import socket - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - bound = None - for unused in range(241): # TIME_WAIT may be as long as 240 secs - try: - if not bound: - s.bind( (host, port) ) - bound = 1 - s.listen(1) - return s - except socket.error, exc: - Log.error(str(exc)) - time.sleep(1) - raise socket.error('Cannot listen on socket %s:%d' % (host, port)) - - def publisher(host, port, ior): - s = listen(host, port) - while 1: - c, a = s.accept() - c.send(ior) - c.close() - def main(): if sys.argv < 4: --- 22,25 ---- *************** *** 72,78 **** c.activatePOA() ! ! import thread ! thread.start_new_thread(publisher, (host, port, c.object_to_string(server))) try: --- 48,52 ---- c.activatePOA() ! c.publish('', port, server) try: |
From: Eric C. N. <eri...@us...> - 2002-05-07 23:40:52
|
Update of /cvsroot/recall/corba In directory usw-pr-cvs1:/tmp/cvs-serv4778 Modified Files: HOWTO.html Log Message: update for host:port designation Index: HOWTO.html =================================================================== RCS file: /cvsroot/recall/corba/HOWTO.html,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** HOWTO.html 11 Feb 2002 15:46:30 -0000 1.14 --- HOWTO.html 7 May 2002 23:40:49 -0000 1.15 *************** *** 269,277 **** <pre> ! python server.py Av/Storage server1 server2 server3 ! python server.py Av/Storage server2 server1 server3 ! python server.py Av/Storage server3 server1 server2 </pre> --- 269,277 ---- <pre> ! python server.py Av/Storage localhost:2001 localhost:2002 localhost:2003 ! python server.py Av/Storage localhost:2002 localhost:2001 localhost:2003 ! python server.py Av/Storage localhost:2003 localhost:2002 localhost:2001 </pre> *************** *** 288,291 **** --- 288,292 ---- from Av import idl + from Recall.CorbaUtil import any def main(): *************** *** 293,307 **** args = [ "-ORBclientCallTimeOutPeriod", "3", "-ORBscanGranularity", "3"] ! c = CorbaUtil.Corba(args) # create local client implementation ! impl = ClientImpl.ClientImpl(c, ['server1', 'server2', 'server3']) c.activatePOA() client = impl._this() writeRequest = \ ! CorbaUtil.any(idl.WriteRequest("my_favorite_color", "blue")) client.write(writeRequest) ! assert client.read("my_favorite_color").value() == "blue" print "Test Successful" --- 294,310 ---- args = [ "-ORBclientCallTimeOutPeriod", "3", "-ORBscanGranularity", "3"] ! c = CorbaUtil.Contexts(args) # create local client implementation ! impl = ClientImpl.ClientImpl(c, ['localhost:2001', ! 'localhost:2002', ! 'localhost:2003']) c.activatePOA() client = impl._this() writeRequest = \ ! any(idl.WriteRequest("my_favorite_color", "blue")) client.write(writeRequest) ! assert (client.read(any("my_favorite_color")).value() == "blue") print "Test Successful" |
From: Eric C. N. <eri...@us...> - 2002-05-07 12:46:45
|
Update of /cvsroot/recall/corba/src/Recall In directory usw-pr-cvs1:/tmp/cvs-serv20421/src/Recall Modified Files: ClientImpl.py CorbaUtil.py DuplicateDetector.py EchoImpl.py Election.py PreserveAgreements.py Recovery.py Replica.py SlaveTimeout.py Log Message: snapshot work for jython/jacorb Index: ClientImpl.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/ClientImpl.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ClientImpl.py 21 Feb 2002 13:11:41 -0000 1.9 --- ClientImpl.py 7 May 2002 12:46:41 -0000 1.10 *************** *** 7,14 **** from Recall import idl import time ! MAX_CALL_TIME = idl.MaxClientRetrySeconds PAUSE_TIME = 0.1 # seconds --- 7,15 ---- from Recall import idl + from Recall import CorbaUtil import time ! MAX_CALL_TIME = CorbaUtil.constant(idl.MaxClientRetrySeconds) PAUSE_TIME = 0.1 # seconds *************** *** 18,23 **** class NotFound(Exception): pass ! import Recall__POA.idl ! class ClientImpl(Recall__POA.idl.Client): "Default implementation of the Recall Client API" --- 19,29 ---- class NotFound(Exception): pass ! try: ! import Recall__POA.idl ! ClientPOA = Recall__POA.idl.Client ! except ImportError: ! from Recall.idl import ClientPOA ! ! class ClientImpl(ClientPOA): "Default implementation of the Recall Client API" *************** *** 30,33 **** --- 36,40 ---- self._servers = servers self._corba = corba + self._corba.activate_object(self) self._request = idl.RequestId(self._this(), self._counter) self.resend_test = int(os.environ.get("RECALL_RESEND", "0")) Index: CorbaUtil.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/CorbaUtil.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CorbaUtil.py 30 Apr 2002 16:21:30 -0000 1.9 --- CorbaUtil.py 7 May 2002 12:46:42 -0000 1.10 *************** *** 14,19 **** def __init__(self, argv): - import time "Initialize the orb, and establish a root and naming context" self.__orb = CORBA.ORB_init(argv, CORBA.ORB_ID) start = time.time() --- 14,19 ---- def __init__(self, argv): "Initialize the orb, and establish a root and naming context" + import time self.__orb = CORBA.ORB_init(argv, CORBA.ORB_ID) start = time.time() *************** *** 27,48 **** Log.error('Waiting for free port') time.sleep(LISTEN_PAUSE) - self.__poa2 = self.__orb.resolve_initial_references("omniINSPOA") ! def activate_object_with_id(self, name, obj): ! self.__poa2.activate_object_with_id(name, obj) def deactivate_object(self, obj): ! self.__poa2.deactivate_object(self.__poa2.servant_to_id(obj)) def find(self, name): ! return self.__orb.string_to_object(name + '/Recall') def activatePOA(self): try: self.__poa._get_the_POAManager().activate() - self.__poa2._get_the_POAManager().activate() except AttributeError: self.__poa.the_POAManager().activate() - self.__poa2.the_POAManager().activate() def run(self): --- 27,65 ---- Log.error('Waiting for free port') time.sleep(LISTEN_PAUSE) ! def activate_object(self, obj): ! return self.__poa.activate_object(obj) def deactivate_object(self, obj): ! return self.__poa.deactivate_object(self.__poa.servant_to_id(obj)) ! ! def object_to_string(self, obj): ! return self.__orb.object_to_string(obj._this()) def find(self, name): ! import string ! host, port = string.split(name, ':') ! port = int(port) ! import socket ! ior = '' ! more = None ! ! try: ! s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ! s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) ! s.connect( (host, port) ) ! while more != '': ! more = s.recv(1000) ! ior += more ! except socket.error, exc: ! return None ! ! return self.__orb.string_to_object(ior) def activatePOA(self): try: self.__poa._get_the_POAManager().activate() except AttributeError: self.__poa.the_POAManager().activate() def run(self): *************** *** 123,125 **** --- 140,149 ---- def any_value(any): return any.value() + + + # java idl constants are accessed through ".value", + # python just gives you the value + + def constant(idl_constant): + return getattr(idl_constant, 'value', idl_constant) Index: DuplicateDetector.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/DuplicateDetector.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DuplicateDetector.py 13 Feb 2002 02:58:00 -0000 1.5 --- DuplicateDetector.py 7 May 2002 12:46:42 -0000 1.6 *************** *** 2,5 **** --- 2,6 ---- from Recall import idl + from Recall import CorbaUtil import time *************** *** 45,49 **** def clean(self): "Call this occasionally to clean out the bookkeeping" ! oldestKeeper = time.time() - idl.MaxClientRetrySeconds requests = [] for r in self.requests: --- 46,51 ---- def clean(self): "Call this occasionally to clean out the bookkeeping" ! oldestKeeper = time.time() - \ ! CorbaUtil.constant(idl.MaxClientRetrySeconds) requests = [] for r in self.requests: *************** *** 61,65 **** return r.result # See notes about "forgetful" client retry ! earliest_first_try = time.time() - idl.MaxClientRetrySeconds if self.start > earliest_first_try: raise idl.NotMaster("Retry too early") --- 63,68 ---- return r.result # See notes about "forgetful" client retry ! earliest_first_try = time.time() - \ ! CorbaUtil.constant(idl.MaxClientRetrySeconds) if self.start > earliest_first_try: raise idl.NotMaster("Retry too early") *************** *** 83,87 **** def unitTest(): d = DuplicateDetector('test', ! time.time() - idl.MaxClientRetrySeconds + 1) MAX=100 --- 86,91 ---- def unitTest(): d = DuplicateDetector('test', ! time.time() - ! CorbaUtil.constant(idl.MaxClientRetrySeconds) + 1) MAX=100 Index: EchoImpl.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/EchoImpl.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** EchoImpl.py 30 Apr 2002 16:21:30 -0000 1.17 --- EchoImpl.py 7 May 2002 12:46:42 -0000 1.18 *************** *** 23,26 **** --- 23,27 ---- import SlaveTimeout import WriteToken + import CorbaUtil import DuplicateDetector *************** *** 29,34 **** from Recall import idl ! import Recall__POA.idl ! class EchoImpl (Recall__POA.idl.Echo): "Implement the Echo algorithm" --- 30,51 ---- from Recall import idl ! try: ! Big = idl.Big ! Prospective = idl.Prospective ! Service = idl.Service ! Data = idl.Data ! except AttributeError: ! Big = idl.EpochType.Big ! Prospective = idl.EpochType.Prospective ! Service = idl.EpochType.Service ! Data = idl.EpochType.Data ! ! try: ! import Recall__POA.idl ! EchoPOA = Recall__POA.idl.Echo ! except ImportError: ! from Recall.idl import EchoPOA ! ! class EchoImpl (EchoPOA): "Implement the Echo algorithm" *************** *** 39,43 **** self.active = [] self._corba = corba ! self._corba.activate_object_with_id("Recall", self) for name in names: self.all.append(Replica.Replica(self._corba, name)) --- 56,60 ---- self.active = [] self._corba = corba ! self._corba.activate_object(self) for name in names: self.all.append(Replica.Replica(self._corba, name)) *************** *** 51,55 **** self._nextId = 0 self.idLock = threading.Lock() ! self._writeToken = WriteToken.WriteToken(idl.NInProgress) self._doomed = None --- 68,72 ---- self._nextId = 0 self.idLock = threading.Lock() ! self._writeToken = WriteToken.WriteToken(CorbaUtil.constant(idl.NInProgress)) self._doomed = None *************** *** 61,65 **** self._epochStorage = strategies.create_epoch_storage() self._inProgress = \ ! strategies.create_in_progress_storage(idl.NInProgress) self._storage = strategies.create_storage(self) --- 78,82 ---- self._epochStorage = strategies.create_epoch_storage() self._inProgress = \ ! strategies.create_in_progress_storage(CorbaUtil.constant(idl.NInProgress)) self._storage = strategies.create_storage(self) *************** *** 70,74 **** self._deferredWrites = None self._stop = None ! time.sleep(idl.MasterTimeoutSeconds) self.restartElection("Start") --- 87,91 ---- self._deferredWrites = None self._stop = None ! time.sleep(CorbaUtil.constant(idl.MasterTimeoutSeconds)) self.restartElection("Start") *************** *** 304,314 **** self.slaveCheck() ss = self.snapshot() ! if which == idl.Service: ss.service = newValue ! if which == idl.Prospective: ss.prospective = newValue ! if which == idl.Big: ss.big = newValue ! if which == idl.Data: ss.data = newValue epochs = (ss.service, ss.prospective, ss.big, ss.data) --- 321,331 ---- self.slaveCheck() ss = self.snapshot() ! if which == Service: ss.service = newValue ! if which == Prospective: ss.prospective = newValue ! if which == Big: ss.big = newValue ! if which == Data: ss.data = newValue epochs = (ss.service, ss.prospective, ss.big, ss.data) *************** *** 318,328 **** def setServiceData(self, newValue): self.slaveCheck() ! self.setEpoch(idl.Service, newValue) ! self.setEpoch(idl.Data, newValue) def setProspectiveService(self, newValue): self.slaveCheck() ! self.setEpoch(idl.Prospective, newValue) ! self.setEpoch(idl.Service, newValue) def redo(self, req): --- 335,345 ---- def setServiceData(self, newValue): self.slaveCheck() ! self.setEpoch(Service, newValue) ! self.setEpoch(Data, newValue) def setProspectiveService(self, newValue): self.slaveCheck() ! self.setEpoch(Prospective, newValue) ! self.setEpoch(Service, newValue) def redo(self, req): *************** *** 354,358 **** finally: self._writeToken.go() ! self.setEpoch(idl.Data, dataEpochValue) def catchup(self, replica, dataEpoch): --- 371,375 ---- finally: self._writeToken.go() ! self.setEpoch(Data, dataEpochValue) def catchup(self, replica, dataEpoch): Index: Election.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/Election.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Election.py 11 Feb 2002 14:53:13 -0000 1.3 --- Election.py 7 May 2002 12:46:42 -0000 1.4 *************** *** 8,11 **** --- 8,12 ---- import Replica import RunState + import CorbaUtil import Log *************** *** 69,73 **** while not self.testStop(): oldCon = con[:] ! time.sleep(idl.ContactStableTimeSeconds) results = Replica.broadcast(echo.all, Replica.Replica.getSnapshot) --- 70,74 ---- while not self.testStop(): oldCon = con[:] ! time.sleep(CorbaUtil.constant(idl.ContactStableTimeSeconds)) results = Replica.broadcast(echo.all, Replica.Replica.getSnapshot) Index: PreserveAgreements.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/PreserveAgreements.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PreserveAgreements.py 11 Feb 2002 14:53:13 -0000 1.3 --- PreserveAgreements.py 7 May 2002 12:46:42 -0000 1.4 *************** *** 6,9 **** --- 6,10 ---- from Recall import idl + from Recall import CorbaUtil import time *************** *** 54,58 **** raise NewContact(`result.keys()`) ! wait = (timeout - idl.MaxTravelTimeSeconds) - time.time() if wait > 0.0: time.sleep(wait) --- 55,59 ---- raise NewContact(`result.keys()`) ! wait = (timeout - CorbaUtil.constant(idl.MaxTravelTimeSeconds)) - time.time() if wait > 0.0: time.sleep(wait) Index: Recovery.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/Recovery.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Recovery.py 11 Feb 2002 14:55:45 -0000 1.8 --- Recovery.py 7 May 2002 12:46:42 -0000 1.9 *************** *** 5,10 **** import RunState import Log ! from Recall import idl class Recovery(Thread.Thread): --- 5,20 ---- import RunState import Log + import CorbaUtil ! from Recall import idl ! ! try: ! Big = idl.Big ! Prospective = idl.Prospective ! Service = idl.Service ! except AttributeError: ! Big = idl.EpochType.Big ! Prospective = idl.EpochType.Prospective ! Service = idl.EpochType.Service class Recovery(Thread.Thread): *************** *** 48,53 **** newEpoch = max(map(lambda x: x.snapshot.big, echo.active)) + 1 ! self.send(echo.active, Replica.Replica.setEpoch, idl.Big, newEpoch) ! self.send(echo.active, Replica.Replica.setEpoch, idl.Prospective, newEpoch) self.send(echo.active, Replica.Replica.setReplicas, echo.thisReplica.snapshot.replicas) --- 58,63 ---- newEpoch = max(map(lambda x: x.snapshot.big, echo.active)) + 1 ! self.send(echo.active, Replica.Replica.setEpoch, Big, newEpoch) ! self.send(echo.active, Replica.Replica.setEpoch, Prospective, newEpoch) self.send(echo.active, Replica.Replica.setReplicas, echo.thisReplica.snapshot.replicas) *************** *** 68,72 **** self.send(upToDate, Replica.Replica.setServiceData, newEpoch) ! self.send(outOfDate, Replica.Replica.setEpoch, idl.Service, newEpoch) echo.runState(RunState.ServingMaster) --- 78,82 ---- self.send(upToDate, Replica.Replica.setServiceData, newEpoch) ! self.send(outOfDate, Replica.Replica.setEpoch, Service, newEpoch) echo.runState(RunState.ServingMaster) *************** *** 81,85 **** push = all.keys() push.sort() ! push = push[-idl.NInProgress:] # send any missing values --- 91,95 ---- push = all.keys() push.sort() ! push = push[-CorbaUtil.constant(idl.NInProgress):] # send any missing values Index: Replica.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/Replica.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Replica.py 30 Apr 2002 16:21:10 -0000 1.15 --- Replica.py 7 May 2002 12:46:42 -0000 1.16 *************** *** 2,5 **** --- 2,17 ---- from Recall import idl + from Recall import CorbaUtil + + try: + Big = idl.Big + Prospective = idl.Prospective + Service = idl.Service + Data = idl.Data + except AttributeError: + Big = idl.EpochType.Big + Prospective = idl.EpochType.Prospective + Service = idl.EpochType.Service + Data = idl.EpochType.Data import CORBA *************** *** 50,60 **** def setEpoch(self, which, newValue): ! if which == idl.Service: self.snapshot.service = newValue ! elif which == idl.Prospective: self.snapshot.prospective = newValue ! elif which == idl.Big: self.snapshot.big = newValue ! elif which == idl.Data: self.snapshot.data = newValue self.obj().setEpoch(which, newValue) --- 62,72 ---- def setEpoch(self, which, newValue): ! if which == Service: self.snapshot.service = newValue ! elif which == Prospective: self.snapshot.prospective = newValue ! elif which == Big: self.snapshot.big = newValue ! elif which == Data: self.snapshot.data = newValue self.obj().setEpoch(which, newValue) *************** *** 96,101 **** def totalTimeout(): ! return idl.MasterTimeoutSeconds * \ ! (1.0 - 2.0 * idl.MaxTimeDiffPercentOfMasterTimeout) def broadcast(replicas, method, *args): --- 108,114 ---- def totalTimeout(): ! return CorbaUtil.constant(idl.MasterTimeoutSeconds) * \ ! (1.0 - 2.0 * ! CorbaUtil.constant(idl.MaxTimeDiffPercentOfMasterTimeout)) def broadcast(replicas, method, *args): *************** *** 109,113 **** except (idl.NotSlave, CORBA.NotFound, CORBA.OBJECT_NOT_EXIST, CORBA.COMM_FAILURE, CORBA.UNKNOWN, ! CORBA.IMP_LIMIT): pass return result --- 122,126 ---- except (idl.NotSlave, CORBA.NotFound, CORBA.OBJECT_NOT_EXIST, CORBA.COMM_FAILURE, CORBA.UNKNOWN, ! CORBA.IMP_LIMIT, BroadcastError): pass return result Index: SlaveTimeout.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/SlaveTimeout.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SlaveTimeout.py 11 Feb 2002 14:53:13 -0000 1.3 --- SlaveTimeout.py 7 May 2002 12:46:42 -0000 1.4 *************** *** 3,6 **** --- 3,8 ---- import time import Thread + import CorbaUtil + from Recall import idl *************** *** 13,17 **** def run(self): ! time.sleep(idl.MasterTimeoutSeconds) if not self.testStop(): self.echo.restartElection("Slave Timeout") --- 15,19 ---- def run(self): ! time.sleep(CorbaUtil.constant(idl.MasterTimeoutSeconds)) if not self.testStop(): self.echo.restartElection("Slave Timeout") |
From: Eric C. N. <eri...@us...> - 2002-05-07 12:46:44
|
Update of /cvsroot/recall/corba/src/Ar In directory usw-pr-cvs1:/tmp/cvs-serv20421/src/Ar Modified Files: Storage.py Log Message: snapshot work for jython/jacorb Index: Storage.py =================================================================== RCS file: /cvsroot/recall/corba/src/Ar/Storage.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Storage.py 13 Feb 2002 02:58:00 -0000 1.9 --- Storage.py 7 May 2002 12:46:41 -0000 1.10 *************** *** 5,15 **** from Ar import idl ! from Recall.CorbaUtil import any, extract_any import pickle import string ! import Recall__POA.idl ! class Storage(Recall__POA.idl.Storage): "Storage implementation that stores integers into a dictionary." --- 5,20 ---- from Ar import idl ! from Recall.CorbaUtil import any, extract_any, constant import pickle import string ! try: ! import Recall__POA.idl ! StoragePOA = Recall__POA.idl.Storage ! except ImportError: ! from Recall.idl import StoragePOA ! ! class Storage(StoragePOA): "Storage implementation that stores integers into a dictionary." *************** *** 83,87 **** def test_write(c): ! n = idl.ARRAY_SIZE for i in range(n): req = idl.WriteRequest(n - i, i) --- 88,92 ---- def test_write(c): ! n = constant(idl.ARRAY_SIZE) for i in range(n): req = idl.WriteRequest(n - i, i) *************** *** 89,93 **** def test_read(c): ! n = idl.ARRAY_SIZE for i in range(n): value = c.read(any(n - i)) --- 94,98 ---- def test_read(c): ! n = constant(idl.ARRAY_SIZE) for i in range(n): value = c.read(any(n - i)) |
From: Eric C. N. <eri...@us...> - 2002-05-07 12:46:44
|
Update of /cvsroot/recall/corba/src In directory usw-pr-cvs1:/tmp/cvs-serv20421/src Modified Files: JPMakefile Makefile recall_test.py recovery_test.sh server.py test.sh test2.py test3.py test_util.sh Log Message: snapshot work for jython/jacorb Index: JPMakefile =================================================================== RCS file: /cvsroot/recall/corba/src/JPMakefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JPMakefile 8 Aug 2001 01:31:47 -0000 1.2 --- JPMakefile 7 May 2002 12:46:41 -0000 1.3 *************** *** 4,27 **** all: always ! rm -f Recall/idl/RecallInterface/* ! $(IDL) -p Recall.idl Recall/Recall.idl ! $(JAVAC) Recall/idl/RecallInterface/*.java ! echo > Recall/idl/RecallInterface/__init__.py ! rm -f IncrDecr/idl/IncrDecrInterface/* ! $(IDL) -p IncrDecr.idl IncrDecr/IncrDecr.idl ! $(JAVAC) IncrDecr/idl/IncrDecrInterface/*.java ! echo > IncrDecr/idl/IncrDecrInterface/__init__.py ! rm -f Ar/idl/ArInterface/* ! $(IDL) -p Ar.idl Ar/Ar.idl ! $(JAVAC) Ar/idl/ArInterface/*.java ! echo > Ar/idl/ArInterface/__init__.py test: always - STORAGE=IncrDecr.Storage PYTHON=$(JACYTHON) sh ./test.sh - STORAGE=IncrDecr.Storage PYTHON=$(JACYTHON) sh ./stress_test.sh - STORAGE=IncrDecr.Storage PYTHON=$(JACYTHON) sh ./recovery_test.sh - STORAGE=Ar.Storage PYTHON=$(JACYTHON) sh ./stress_test.sh STORAGE=Ar.Storage PYTHON=$(JACYTHON) sh ./test.sh --- 4,23 ---- all: always ! rm -rf Recall/idl ! $(IDL) Recall/Recall.idl ! echo >Recall/__init__.py ! $(JAVAC) Recall/idl/*.java ! rm -rf IncrDecr/idl ! $(IDL) IncrDecr/IncrDecr.idl ! echo >IncrDecr/__init__.py ! $(JAVAC) IncrDecr/idl/*.java ! rm -rf Ar/idl ! $(IDL) Ar/Ar.idl ! echo >Ar/__init__.py ! $(JAVAC) Ar/idl/*.java test: always STORAGE=Ar.Storage PYTHON=$(JACYTHON) sh ./stress_test.sh STORAGE=Ar.Storage PYTHON=$(JACYTHON) sh ./test.sh Index: Makefile =================================================================== RCS file: /cvsroot/recall/corba/src/Makefile,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Makefile 1 May 2002 23:20:02 -0000 1.35 --- Makefile 7 May 2002 12:46:41 -0000 1.36 *************** *** 37,40 **** --- 37,41 ---- clean: + rm -rf *__POA *_idl.py find .. -name "*.pyc" -print | xargs rm -f find .. -name "*~" -print | xargs rm -f Index: recall_test.py =================================================================== RCS file: /cvsroot/recall/corba/src/recall_test.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** recall_test.py 21 Feb 2002 13:02:31 -0000 1.15 --- recall_test.py 7 May 2002 12:46:41 -0000 1.16 *************** *** 13,17 **** def election_wait(): ! time.sleep(idl.MasterTimeoutSeconds + idl.ContactStableTimeSeconds) def debug(*args): --- 13,18 ---- def election_wait(): ! time.sleep(CorbaUtil.constant(idl.MasterTimeoutSeconds) + ! CorbaUtil.constant(idl.ContactStableTimeSeconds)) def debug(*args): *************** *** 20,26 **** def client(): ! sys.argv = sys.argv + [ "-ORBclientCallTimeOutPeriod", "3", ! "-ORBscanGranularity", "3"] ! c = CorbaUtil.Contexts(sys.argv) # create client impl = ClientImpl.ClientImpl(c, sys.argv[2:]) --- 21,26 ---- def client(): ! argv = [ "-ORBclientCallTimeOutPeriod", "3", "-ORBscanGranularity", "3"] ! c = CorbaUtil.Contexts(argv) # create client impl = ClientImpl.ClientImpl(c, sys.argv[2:]) Index: recovery_test.sh =================================================================== RCS file: /cvsroot/recall/corba/src/recovery_test.sh,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** recovery_test.sh 21 Feb 2002 13:02:01 -0000 1.8 --- recovery_test.sh 7 May 2002 12:46:41 -0000 1.9 *************** *** 21,24 **** --- 21,25 ---- sleep $RECOVER_TIME + sleep $RESTART_TIME done Index: server.py =================================================================== RCS file: /cvsroot/recall/corba/src/server.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** server.py 21 Feb 2002 13:03:52 -0000 1.16 --- server.py 7 May 2002 12:46:41 -0000 1.17 *************** *** 22,25 **** --- 22,49 ---- return self.ctor(echo) + def listen(host, port): + import socket + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + bound = None + for unused in range(241): # TIME_WAIT may be as long as 240 secs + try: + if not bound: + s.bind( (host, port) ) + bound = 1 + s.listen(1) + return s + except socket.error, exc: + Log.error(str(exc)) + time.sleep(1) + raise socket.error('Cannot listen on socket %s:%d' % (host, port)) + + def publisher(host, port, ior): + s = listen(host, port) + while 1: + c, a = s.accept() + c.send(ior) + c.close() + def main(): if sys.argv < 4: *************** *** 29,40 **** servers = sys.argv[2:] import string ! port = string.atoi(string.split(sys.argv[2], ':')[3]) # Set max message timeout within corba timeout = idl.MessageSendTimeoutSeconds c = CorbaUtil.Contexts([ "-ORBclientCallTimeOutPeriod", `timeout`, ! "-ORBscanGranularity", `timeout`, ! "-ORBpoa_iiop_port", `port`]) ! # Set log level Log.name(sys.argv[2]) --- 53,65 ---- servers = sys.argv[2:] import string ! host, port = string.split(sys.argv[2], ':') ! port = int(port) # Set max message timeout within corba timeout = idl.MessageSendTimeoutSeconds c = CorbaUtil.Contexts([ "-ORBclientCallTimeOutPeriod", `timeout`, ! "-ORBscanGranularity", `timeout`,]) ! # "-ORBtraceLevel", `5`]) ! # Set log level Log.name(sys.argv[2]) *************** *** 45,49 **** --- 70,79 ---- server = EchoImpl.EchoImpl(c, servers, Factory(servers[0], storage_ctor)) + c.activatePOA() + + import thread + thread.start_new_thread(publisher, (host, port, c.object_to_string(server))) + try: c.run() *************** *** 66,67 **** --- 96,98 ---- print "Recall server failed in %f seconds.\n" \ "Is another program using the specified port?" % failtime + Log.message("Server Stopped") Index: test.sh =================================================================== RCS file: /cvsroot/recall/corba/src/test.sh,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** test.sh 21 Feb 2002 13:04:20 -0000 1.17 --- test.sh 7 May 2002 12:46:41 -0000 1.18 *************** *** 33,36 **** --- 33,37 ---- sleep $STARTUP_TIME + sleep $RESTART_TIME echo "Re-running read/write test" Index: test2.py =================================================================== RCS file: /cvsroot/recall/corba/src/test2.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test2.py 21 Feb 2002 13:04:45 -0000 1.5 --- test2.py 7 May 2002 12:46:41 -0000 1.6 *************** *** 10,14 **** def main(): ! foo = "corbaloc::localhost:5000" c = recall_test.client() current = list(c.getReplicaSet()) --- 10,14 ---- def main(): ! foo = "localhost:5000" c = recall_test.client() current = list(c.getReplicaSet()) Index: test3.py =================================================================== RCS file: /cvsroot/recall/corba/src/test3.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test3.py 11 Feb 2002 14:53:12 -0000 1.11 --- test3.py 7 May 2002 12:46:41 -0000 1.12 *************** *** 8,16 **** debug = recall_test.debug ! from Recall.CorbaUtil import any, any_value, any_type def main(): c = recall_test.client() ! result = c.read(any(idl.ARRAY_SIZE * 2)) debug("Read: ", result) indent = " " * 4 --- 8,16 ---- debug = recall_test.debug ! from Recall.CorbaUtil import any, any_value, any_type, constant def main(): c = recall_test.client() ! result = c.read(any(constant(idl.ARRAY_SIZE) * 2)) debug("Read: ", result) indent = " " * 4 Index: test_util.sh =================================================================== RCS file: /cvsroot/recall/corba/src/test_util.sh,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** test_util.sh 30 Apr 2002 11:37:03 -0000 1.25 --- test_util.sh 7 May 2002 12:46:41 -0000 1.26 *************** *** 8,11 **** --- 8,12 ---- STARTUP_TIME=`python -c "print int($MasterTimeoutSeconds*2 + $ContactStableTimeSeconds)"` RECOVER_TIME=`python -c "print int($MasterTimeoutSeconds*2 + $ContactStableTimeSeconds)"` + RESTART_TIME=0 bad=0 *************** *** 21,25 **** PYTHON=python fi ! KILL="kill -TERM" if $PYTHON -c 'import java' >/dev/null 2>&1 --- 22,26 ---- PYTHON=python fi ! KILL="kill -INT" if $PYTHON -c 'import java' >/dev/null 2>&1 *************** *** 27,33 **** STARTUP_TIME=`expr $STARTUP_TIME + 25` RECOVER_TIME=`expr $RECOVER_TIME + 5` fi ! PREFIX=corbaloc::localhost:200 ARGS="${PREFIX}2 ${PREFIX}3 ${PREFIX}4" --- 28,35 ---- STARTUP_TIME=`expr $STARTUP_TIME + 25` RECOVER_TIME=`expr $RECOVER_TIME + 5` + RESTART_TIME=45 fi ! PREFIX=localhost:200 ARGS="${PREFIX}2 ${PREFIX}3 ${PREFIX}4" |
From: Eric C. N. <eri...@us...> - 2002-05-01 23:26:26
|
Update of /cvsroot/recall/corba/src In directory usw-pr-cvs1:/tmp/cvs-serv4151 Modified Files: Makefile Log Message: build stubs for Av, too. Index: Makefile =================================================================== RCS file: /cvsroot/recall/corba/src/Makefile,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Makefile 13 Feb 2002 02:57:59 -0000 1.34 --- Makefile 1 May 2002 23:20:02 -0000 1.35 *************** *** 45,49 **** $(IDLPY): $(GENS) $(IDLFILES) ! @for i in $(IDLDIRS) ;\ do \ echo generating idl for $$i ; \ --- 45,49 ---- $(IDLPY): $(GENS) $(IDLFILES) ! @for i in $(patsubst %/idl,%,$(IDLDIRS)) ;\ do \ echo generating idl for $$i ; \ |
From: Eric C. N. <eri...@us...> - 2002-05-01 23:09:05
|
Update of /cvsroot/recall/corba/src/Av In directory usw-pr-cvs1:/tmp/cvs-serv1861/Av Modified Files: simple_test.sh Log Message: fixup this little script Index: simple_test.sh =================================================================== RCS file: /cvsroot/recall/corba/src/Av/simple_test.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** simple_test.sh 22 Jun 2001 17:50:34 -0000 1.2 --- simple_test.sh 1 May 2002 23:09:01 -0000 1.3 *************** *** 1,10 **** #! /bin/sh cd .. ! python server.py Av.Storage server1 server2 server3 & PIDS="$!" ! python server.py Av.Storage server2 server1 server3 & PIDS="$PIDS $!" ! python server.py Av.Storage server3 server2 server1 & PIDS="$PIDS $!" --- 1,11 ---- #! /bin/sh + BASE=corbaloc::localhost:200 cd .. ! python server.py Av.Storage ${BASE}1 ${BASE}2 ${BASE}3 & PIDS="$!" ! python server.py Av.Storage ${BASE}2 ${BASE}1 ${BASE}3 & PIDS="$PIDS $!" ! python server.py Av.Storage ${BASE}3 ${BASE}2 ${BASE}1 & PIDS="$PIDS $!" |
From: Eric C. N. <eri...@us...> - 2002-04-30 16:21:32
|
Update of /cvsroot/recall/corba/src/Recall In directory usw-pr-cvs1:/tmp/cvs-serv8223/Recall Modified Files: CorbaUtil.py EchoImpl.py Log Message: have to deactivate Echo object to support restarts Index: CorbaUtil.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/CorbaUtil.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CorbaUtil.py 30 Apr 2002 11:37:28 -0000 1.8 --- CorbaUtil.py 30 Apr 2002 16:21:30 -0000 1.9 *************** *** 17,21 **** "Initialize the orb, and establish a root and naming context" self.__orb = CORBA.ORB_init(argv, CORBA.ORB_ID) - start = time.time() while 1: --- 17,20 ---- *************** *** 33,36 **** --- 32,38 ---- self.__poa2.activate_object_with_id(name, obj) + def deactivate_object(self, obj): + self.__poa2.deactivate_object(self.__poa2.servant_to_id(obj)) + def find(self, name): return self.__orb.string_to_object(name + '/Recall') Index: EchoImpl.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/EchoImpl.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** EchoImpl.py 21 Feb 2002 13:12:24 -0000 1.16 --- EchoImpl.py 30 Apr 2002 16:21:30 -0000 1.17 *************** *** 379,380 **** --- 379,381 ---- self._stop = 1 self.restartElection("Stopping") + self._corba.deactivate_object(self) |
From: Eric C. N. <eri...@us...> - 2002-04-30 16:21:14
|
Update of /cvsroot/recall/corba/src/Recall In directory usw-pr-cvs1:/tmp/cvs-serv8119/Recall Modified Files: Replica.py Log Message: remove useless line Index: Replica.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/Replica.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Replica.py 21 Feb 2002 13:22:15 -0000 1.14 --- Replica.py 30 Apr 2002 16:21:10 -0000 1.15 *************** *** 21,25 **** def obj(self): if not self.object: - # obj = self._corba.find(self.name + "/Recall") obj = self._corba.find(self.name) if not obj: --- 21,24 ---- |
From: Eric C. N. <eri...@us...> - 2002-04-30 16:17:51
|
Update of /cvsroot/recall/corba/src/Demo In directory usw-pr-cvs1:/tmp/cvs-serv6947/Demo Modified Files: simple_test.sh Log Message: use corbaloc: specifiers Index: simple_test.sh =================================================================== RCS file: /cvsroot/recall/corba/src/Demo/simple_test.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** simple_test.sh 8 Jul 2001 19:57:54 -0000 1.5 --- simple_test.sh 30 Apr 2002 16:17:48 -0000 1.6 *************** *** 15,23 **** trap quit 1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 ! python Demo/Client.py a b c & PIDS="$PIDS $!" ! python Demo/Client.py b a c & PIDS="$PIDS $!" ! python Demo/Client.py c a b & PIDS="$PIDS $!" --- 15,28 ---- trap quit 1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 ! BASE=corbaloc::localhost:200 ! A=${BASE}1 ! B=${BASE}2 ! C=${BASE}3 ! ! python Demo/Client.py $A $B $C & PIDS="$PIDS $!" ! python Demo/Client.py $B $A $C & PIDS="$PIDS $!" ! python Demo/Client.py $C $A $B & PIDS="$PIDS $!" |
From: Eric C. N. <eri...@us...> - 2002-04-30 16:17:38
|
Update of /cvsroot/recall/corba/src/Demo In directory usw-pr-cvs1:/tmp/cvs-serv6895/Demo Modified Files: Client.py Log Message: force the port # Index: Client.py =================================================================== RCS file: /cvsroot/recall/corba/src/Demo/Client.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Client.py 13 Feb 2002 02:58:00 -0000 1.10 --- Client.py 30 Apr 2002 16:17:35 -0000 1.11 *************** *** 131,138 **** def main(self): import Recall.idl timeout = Recall.idl.MessageSendTimeoutSeconds args = [ "-ORBclientCallTimeOutPeriod", `timeout`, ! "-ORBscanGranularity", `timeout`] self.contexts = CorbaUtil.Contexts(args) --- 131,142 ---- def main(self): + import string + port = string.atoi(string.split(sys.argv[1], ':')[3]) + import Recall.idl timeout = Recall.idl.MessageSendTimeoutSeconds args = [ "-ORBclientCallTimeOutPeriod", `timeout`, ! "-ORBscanGranularity", `timeout`, ! "-ORBpoa_iiop_port", `port`] self.contexts = CorbaUtil.Contexts(args) |
From: Eric C. N. <eri...@us...> - 2002-04-30 11:37:31
|
Update of /cvsroot/recall/corba/src/Recall In directory usw-pr-cvs1:/tmp/cvs-serv18708/Recall Modified Files: CorbaUtil.py Log Message: add wait for designated port Index: CorbaUtil.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/CorbaUtil.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CorbaUtil.py 21 Feb 2002 13:11:12 -0000 1.7 --- CorbaUtil.py 30 Apr 2002 11:37:28 -0000 1.8 *************** *** 3,16 **** import CORBA CosNaming = CORBA.CosNaming NoNamingContext = "no naming context" class Contexts: "A class to simplify access to CORBA and contexts" def __init__(self, argv): "Initialize the orb, and establish a root and naming context" self.__orb = CORBA.ORB_init(argv, CORBA.ORB_ID) ! self.__poa = self.__orb.resolve_initial_references("RootPOA") self.__poa2 = self.__orb.resolve_initial_references("omniINSPOA") --- 3,31 ---- import CORBA CosNaming = CORBA.CosNaming + import Log NoNamingContext = "no naming context" + LISTEN_TIMEOUT = 5.0 + LISTEN_PAUSE = 1.0 + class Contexts: "A class to simplify access to CORBA and contexts" def __init__(self, argv): + import time "Initialize the orb, and establish a root and naming context" self.__orb = CORBA.ORB_init(argv, CORBA.ORB_ID) ! ! start = time.time() ! while 1: ! try: ! self.__poa = self.__orb.resolve_initial_references("RootPOA") ! break ! except Exception, exc: ! if time.time() - start > LISTEN_TIMEOUT: ! raise ! Log.error('Waiting for free port') ! time.sleep(LISTEN_PAUSE) self.__poa2 = self.__orb.resolve_initial_references("omniINSPOA") |
From: Eric C. N. <eri...@us...> - 2002-04-30 11:37:06
|
Update of /cvsroot/recall/corba/src In directory usw-pr-cvs1:/tmp/cvs-serv18567 Modified Files: test_util.sh Log Message: add wait for thread children Index: test_util.sh =================================================================== RCS file: /cvsroot/recall/corba/src/test_util.sh,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** test_util.sh 21 Feb 2002 13:05:46 -0000 1.24 --- test_util.sh 30 Apr 2002 11:37:03 -0000 1.25 *************** *** 37,42 **** wait $PIDS >/dev/null 2>&1 sleep 1 ! pids=`ps -elf | grep 'python server.py' | grep -v grep | awk '{ print $2 }'` ! if [ x"$pids" != x ] ; then echo Unkilled threads ; exit 1; fi } --- 37,52 ---- wait $PIDS >/dev/null 2>&1 sleep 1 ! ! # on linux, sometimes the kill works on the parent thread, ! # but children linger. Give them a chance to die, too. ! for i in 1 2 3 4 5 ! do ! pids=`ps -elf | grep 'python server.py' | grep -v grep | awk '{ print $2 }'` ! if [ x"$pids" == x ] ; then return 0; fi ! echo Unkilled threads ! sleep 1 ! done ! # Give up! They're never going to die. ! exit 1 } |
From: Neal N. <nno...@us...> - 2002-02-21 13:22:19
|
Update of /cvsroot/recall/corba/src/Recall In directory usw-pr-cvs1:/tmp/cvs-serv4505 Modified Files: Replica.py Log Message: fix whitespace Index: Replica.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/Replica.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Replica.py 21 Feb 2002 13:12:46 -0000 1.13 --- Replica.py 21 Feb 2002 13:22:15 -0000 1.14 *************** *** 25,30 **** if not obj: raise BroadcastError("cannot find object named " + self.name) ! self.object = \ ! CORBA.narrow(obj, idl.Echo) return self.object --- 25,29 ---- if not obj: raise BroadcastError("cannot find object named " + self.name) ! self.object = CORBA.narrow(obj, idl.Echo) return self.object |
From: Neal N. <ne...@me...> - 2002-02-21 13:20:14
|
"Eric C. Newton" wrote: > Index: CorbaUtil.py > =================================================================== > RCS file: /cvsroot/recall/corba/src/Recall/CorbaUtil.py,v > retrieving revision 1.6 > retrieving revision 1.7 > diff -C2 -d -r1.6 -r1.7 > *** CorbaUtil.py 13 Feb 2002 02:58:00 -0000 1.6 > --- CorbaUtil.py 21 Feb 2002 13:11:12 -0000 1.7 > *************** > --- 11,31 ---- > def __init__(self, argv): > "Initialize the orb, and establish a root and naming context" > self.__orb = CORBA.ORB_init(argv, CORBA.ORB_ID) > self.__poa = self.__orb.resolve_initial_references("RootPOA") > ! self.__poa2 = self.__orb.resolve_initial_references("omniINSPOA") Doesn't this prevent portability to other ORBs? By using the omniINSPOA? Is there an ORB independant way to do what you are doing? Neal |
From: Eric C. N. <eri...@us...> - 2002-02-21 13:12:49
|
Update of /cvsroot/recall/corba/src/Recall In directory usw-pr-cvs1:/tmp/cvs-serv32188/Recall Modified Files: Replica.py Log Message: stop using name server, deal with object lookup failures Index: Replica.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/Replica.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Replica.py 13 Feb 2002 02:58:00 -0000 1.12 --- Replica.py 21 Feb 2002 13:12:46 -0000 1.13 *************** *** 21,26 **** def obj(self): if not self.object: self.object = \ ! CORBA.narrow(self._corba.find(self.name), idl.Echo) return self.object --- 21,30 ---- def obj(self): if not self.object: + # obj = self._corba.find(self.name + "/Recall") + obj = self._corba.find(self.name) + if not obj: + raise BroadcastError("cannot find object named " + self.name) self.object = \ ! CORBA.narrow(obj, idl.Echo) return self.object *************** *** 105,109 **** except idl.DeferredWrite: result[r] = None ! except (idl.NotSlave, CORBA.NotFound, CORBA.COMM_FAILURE, CORBA.UNKNOWN, CORBA.IMP_LIMIT): --- 109,113 ---- except idl.DeferredWrite: result[r] = None ! except (idl.NotSlave, CORBA.NotFound, CORBA.OBJECT_NOT_EXIST, CORBA.COMM_FAILURE, CORBA.UNKNOWN, CORBA.IMP_LIMIT): |
From: Eric C. N. <eri...@us...> - 2002-02-21 13:12:30
|
Update of /cvsroot/recall/corba/src/Recall In directory usw-pr-cvs1:/tmp/cvs-serv31992/Recall Modified Files: EchoImpl.py Log Message: stop using name server Index: EchoImpl.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/EchoImpl.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** EchoImpl.py 13 Feb 2002 02:58:00 -0000 1.15 --- EchoImpl.py 21 Feb 2002 13:12:24 -0000 1.16 *************** *** 39,44 **** self.active = [] self._corba = corba ! self._corba.servant_to_reference(self) ! self._corba.bind(names[0], self._this()) for name in names: self.all.append(Replica.Replica(self._corba, name)) --- 39,43 ---- self.active = [] self._corba = corba ! self._corba.activate_object_with_id("Recall", self) for name in names: self.all.append(Replica.Replica(self._corba, name)) *************** *** 378,382 **** def stop(self): - self._corba.bind(self.thisReplica.name, None) self._stop = 1 self.restartElection("Stopping") --- 377,380 ---- |
From: Eric C. N. <eri...@us...> - 2002-02-21 13:11:44
|
Update of /cvsroot/recall/corba/src/Recall In directory usw-pr-cvs1:/tmp/cvs-serv31670/Recall Modified Files: ClientImpl.py Log Message: stop using name server, deal with fail object lookups Index: ClientImpl.py =================================================================== RCS file: /cvsroot/recall/corba/src/Recall/ClientImpl.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ClientImpl.py 13 Feb 2002 02:58:00 -0000 1.8 --- ClientImpl.py 21 Feb 2002 13:11:41 -0000 1.9 *************** *** 16,19 **** --- 16,21 ---- return names[1:] + [names[0]] + class NotFound(Exception): pass + import Recall__POA.idl class ClientImpl(Recall__POA.idl.Client): *************** *** 36,39 **** --- 38,43 ---- self._servers = _rotate(self._servers) obj = self._corba.find(self._servers[0]) + if not obj: + raise NotFound(self._servers[0] + " not found") self._server = CORBA.narrow(obj, idl.Echo) return self._server *************** *** 47,53 **** try: return self.attempt(name, args) ! except (CORBA.NotFound, CORBA.COMM_FAILURE, CORBA.UNKNOWN, CORBA.IMP_LIMIT, ! idl.NotMaster): pass self._server = None --- 51,57 ---- try: return self.attempt(name, args) ! except (CORBA.NotFound, CORBA.OBJECT_NOT_EXIST, CORBA.COMM_FAILURE, CORBA.UNKNOWN, CORBA.IMP_LIMIT, ! idl.NotMaster, NotFound): pass self._server = None *************** *** 70,76 **** for r in results: assert(r == results[0]) ! except (CORBA.NotFound, CORBA.COMM_FAILURE, CORBA.UNKNOWN, CORBA.IMP_LIMIT, ! idl.NotMaster): pass retry = 1 --- 74,80 ---- for r in results: assert(r == results[0]) ! except (CORBA.NotFound, CORBA.OBJECT_NOT_EXIST, CORBA.COMM_FAILURE, CORBA.UNKNOWN, CORBA.IMP_LIMIT, ! idl.NotMaster, NotFound): pass retry = 1 |