I have a problem with setting up lime. I have two limeagents with a LimeConsole, they can only communicate when they are on the same LimeServer. If I start two limeagents with a LimeConsole on the same host (or on two different), using debug mode, they seem to be able to "see" each other, according to the "GroupList". However, when I "out" a <Hello>, the other LimeConsole cannot rdp the <Hello>. Both agents have a LimeSystemTupleSpace, their LimeTupleSpace have the same name, engage is on...
Sometimes, one of the two Consoles "hangs". The output of this console is:
[java] Lime:Factory set to lights.adapters.builtin.TupleSpaceFactory
[java] Lime:Constructing a Lime TS Mgr called SYSTEM
[java] Lime:Reactor of TS SYSTEM: Running a reactive program with 0 reactions
[java] Lime:Reactor's contents for tsnamed: SYSTEM
[java] Lime:start following chain of reactions:
[java] Lime:done following chain of reactions:
[java] Lime:Entering main loop
[java] Lime:LTSMgr: SYSTEM inTransaction is false
[java] Lime:LTSM: SYSTEM waiting to get an operation to execute
[java] Lime:Listening for incoming agents
[java] Lime:INCOMING_MGR: Waiting for connection
[java] groupmgmt:SinglePhaseDisseminator: DebugFrame initialized.
[java] Lime:Adding myself as a group changed listener
[java] groupmgmt:SinglePhaseDisseminator: Starting
[java] groupmgmt:SinglePhaseDisseminator: ***GroupChangedEvent*** - [[Paullaptop/10.0.0.1:1978]]
[java] groupmgmt:GroupManager: processing group changed event
[java] groupmgmt:GroupManager: This group is different, notify listeners
[java] groupmgmt:GroupManager: listeners not notified of self engagement
[java] groupmgmt:SafeDistanceDetector: Starting
[java] Lime:Lime server Paullaptop:1978 activated
[java] Lime:Agent testagents.TestAgent loaded and started.
[java] Lime:Created a tuple space with name: twee_434693445_1
[java] 1: Paullaptop:1978
[java] TestAgent: Host engaged.
[java] groupmgmt:SafeDistanceDetector: Discovered neighbor - [Paullaptop/10.0.0.1:1978]
[java] groupmgmt:SinglePhaseDisseminator: Enqueing connections from [Paullaptop/10.0.0.1:1978] -
[java] groupmgmt:SinglePhaseDisseminator: arriving - [[Paullaptop/10.0.0.1:1978]]
[java] groupmgmt:SinglePhaseDisseminator: departing - []
[java] groupmgmt:SinglePhaseDisseminator: Processing arriving - [Paullaptop/10.0.0.1:1978] connected to [Paullaptop/10.
0.0.1:1978]
[java] groupmgmt:SinglePhaseDisseminator: Starting to process arrival
[java] groupmgmt:SinglePhaseDisseminator: Just adding connection
[java] Lime:The waiter executed, index=2
[java] Lime:Entering main loop
[java] Lime:LTSMgr: SYSTEM inTransaction is true
[java] Lime:Tuple Space: SYSTEM waiting on transaction
[java] Lime:sending a message
[java] Lime:INCOMING_THREAD: Connection received
[java] Lime:INCOMING_MGR: Waiting for connection
[java] Lime:About to write
[java] Lime:INCOMING_THREAD: Received transaction op descriptor
[java] Lime:TransDescriptor: isTansDone: Begin method call
[java] Lime:Constructing a Lime TS Mgr called twee
[java] Lime:Entering main loop
[java] Lime:LTSMgr: twee inTransaction is true
[java] Lime:Tuple Space: twee waiting on transaction
[java] Lime:Reactor of TS SYSTEM: Running a reactive program with 0 reactions
[java] Lime:Reactor's contents for tsnamed: SYSTEM
[java] Lime:start following chain of reactions:
[java] Lime:done following chain of reactions:
[java] Lime:Reactor of TS SYSTEM: Running a reactive program with 0 reactions
[java] Lime:Reactor's contents for tsnamed: SYSTEM
[java] Lime:start following chain of reactions:
[java] Lime:done following chain of reactions:
[java] Lime:Reactor of TS SYSTEM: Running a reactive program with 0 reactions
[java] Lime:Reactor's contents for tsnamed: SYSTEM
[java] Lime:start following chain of reactions:
[java] Lime:done following chain of reactions:
[java] Lime:Reactor of TS twee: Running a reactive program with 0 reactions
[java] Lime:Reactor's contents for tsnamed: twee
[java] Lime:start following chain of reactions:
[java] Lime:done following chain of reactions:
[java] groupmgmt:GroupManager: Resuming updates
[java] groupmgmt:GroupManager: Updates resumed
[java] Lime:TupleSpace: SYSTEM no longer waiting on transaction
[java] Lime:Transaction completed in s = 62
[java] Lime:LTSM: SYSTEM waiting to get an operation to execute
[java] Lime:TupleSpace: twee no longer waiting on transaction
[java] TestAgent: true
[java] TestAgent: lts shared.
[java] Lime:Transaction completed in s = 31
[java] Lime:LTSM: twee waiting to get an operation to execute
[java] Lime:The waiter executed, index=2
[java] Lime:Entering main loop
[java] Lime:LTSMgr: twee inTransaction is false
[java] Lime:LTSM: twee waiting to get an operation to execute
[java] Lime:Received 1 descriptors from PAULLAPTOP:1743
[java] groupmgmt:SafeDistanceDetector: Discovered neighbor - [PaulHome/10.0.0.2:1973]
[java] groupmgmt:SinglePhaseDisseminator: Enqueing connections from [Paullaptop/10.0.0.1:1978] -
[java] groupmgmt:SinglePhaseDisseminator: arriving - [[PaulHome/10.0.0.2:1973]]
[java] groupmgmt:SinglePhaseDisseminator: departing - []
[java] groupmgmt:SinglePhaseDisseminator: Processing arriving - [Paullaptop/10.0.0.1:1978] connected to [PaulHome/10.0.
0.2:1973]
[java] groupmgmt:SinglePhaseDisseminator: Starting to process arrival
[java] groupmgmt:SinglePhaseDisseminator: Sending GetLeaderMessage to new Member - [PaulHome/10.0.0.2:1973]
[java] groupmgmt:SinglePhaseDisseminator: Got LeaderAddressMessage. Sending GroupInfoMessage
[java] groupmgmt:SinglePhaseDisseminator: Other leader is [PaulHome/10.0.0.2:1973]
[java] groupmgmt:SinglePhaseDisseminator: Got GroupChangeMessage. Firing GroupChangedEvent
[java] groupmgmt:SinglePhaseDisseminator: I'm a follower. Members = [[Paullaptop/10.0.0.1:1978], [PaulHome/10.0.0.2:197
3]]
[java] groupmgmt:SinglePhaseDisseminator: Finished engaging with [PaulHome/10.0.0.2:1973].
[java] groupmgmt:SinglePhaseDisseminator: ***GroupChangedEvent*** - [[Paullaptop/10.0.0.1:1978], [PaulHome/10.0.0.2:1973
]]
[java] groupmgmt:GroupManager: processing group changed event
[java] groupmgmt:GroupManager: This group is different, notify listeners
[java] groupmgmt:GroupManager: firing group changed event
[java] groupmgmt:GroupManager: updating 1 listeners
[java] Lime:---------------Adding: newGroupMembers contains me
[java] Lime:The waiter executed, index=2
[java] Lime:Entering main loop
[java] Lime:LTSMgr: twee inTransaction is true
[java] Lime:Tuple Space: twee waiting on transaction
[java] Lime:The waiter executed, index=2
[java] Lime:Entering main loop
[java] Lime:LTSMgr: SYSTEM inTransaction is true
[java] Lime:Tuple Space: SYSTEM waiting on transaction
[java] Lime:sending a message
[java] Lime:About to write
Any idea what I am doing wrong?? Please indicate if more information is needed.
Kind regards,
pkl
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Admittedly I did not read all the output carefully, but the problem is likely the parameter "current" you are using in the rdp operation. You need to use either the AgentLocation (ID) of the host that wrote the tuple or the HostLocation where the writing agent is residing.
Another thing to try is a rd instead of a rdp. Use cur=unspecified in the rd. If this doesn't find the tuple, then there is a problem with connectivity of some sort.
If this doesn't help, try posting the out operation from Agent1 and your rdp operation from Agent2.
-Amy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you very much (again) for you fast reply. I have seen it working now...
I must admit that I do not know why the LimeConsole sometimes crashes, but that doesn't matter (yet).
I have another small question about templates (e.g. rd with a template as arguments). How does this work? Is there any information about this other than that in the api?
Kind regards,
pkl
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you're asking how matching happens, I suggest reading the LightTS documentation. There is a link from the Lime web pages, or lights.sf.net.
The short answer is that a template is just a tuple with some of the fields formal. So, <string> matches <"foo">. You create templates just like you create tuples with LighTS, and the matches method is well described in the LighTS documentation.
-Amy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you. The documentation was helpfull. However, I have another question:
I (finally) got it working, but when I shutdown one of my agents without calling the disengage method, the agent at the other host does not notice that the agent+limeserver are gone. This results in a SocketException when I execute a rdg on the tuplespace of the agent that is gone (of course, this is not so strange).
What I would like to know is whether there is a way to detect when an agent+limeserver are gone, without having to call the disengage method every time an agent leaves the community?
Kind regards,
pkl
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Unfortunately, this behavior is the documented "correct" behavior. The version of Lime you are using EXPECTS announced disconnection. If a host does not announce its disconnection, the system does not recover from it.
We actually have another version of Lime that will be released in January. This new version is a rather complete re-work of Lime that handles the kind of un-announced disconnection that you are asking about.
If you want more details, send me an email and we can "chat" about it.
-Amy
amy.murphy@unisi.ch
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have a problem with setting up lime. I have two limeagents with a LimeConsole, they can only communicate when they are on the same LimeServer. If I start two limeagents with a LimeConsole on the same host (or on two different), using debug mode, they seem to be able to "see" each other, according to the "GroupList". However, when I "out" a <Hello>, the other LimeConsole cannot rdp the <Hello>. Both agents have a LimeSystemTupleSpace, their LimeTupleSpace have the same name, engage is on...
Sometimes, one of the two Consoles "hangs". The output of this console is:
[java] Lime:Factory set to lights.adapters.builtin.TupleSpaceFactory
[java] Lime:Constructing a Lime TS Mgr called SYSTEM
[java] Lime:Reactor of TS SYSTEM: Running a reactive program with 0 reactions
[java] Lime:Reactor's contents for tsnamed: SYSTEM
[java] Lime:start following chain of reactions:
[java] Lime:done following chain of reactions:
[java] Lime:Entering main loop
[java] Lime:LTSMgr: SYSTEM inTransaction is false
[java] Lime:LTSM: SYSTEM waiting to get an operation to execute
[java] Lime:Listening for incoming agents
[java] Lime:INCOMING_MGR: Waiting for connection
[java] groupmgmt:SinglePhaseDisseminator: DebugFrame initialized.
[java] Lime:Adding myself as a group changed listener
[java] groupmgmt:SinglePhaseDisseminator: Starting
[java] groupmgmt:SinglePhaseDisseminator: ***GroupChangedEvent*** - [[Paullaptop/10.0.0.1:1978]]
[java] groupmgmt:GroupManager: processing group changed event
[java] groupmgmt:GroupManager: This group is different, notify listeners
[java] groupmgmt:GroupManager: listeners not notified of self engagement
[java] groupmgmt:SafeDistanceDetector: Starting
[java] Lime:Lime server Paullaptop:1978 activated
[java] Lime:Agent testagents.TestAgent loaded and started.
[java] Lime:Created a tuple space with name: twee_434693445_1
[java] 1: Paullaptop:1978
[java] TestAgent: Host engaged.
[java] groupmgmt:SafeDistanceDetector: Discovered neighbor - [Paullaptop/10.0.0.1:1978]
[java] groupmgmt:SinglePhaseDisseminator: Enqueing connections from [Paullaptop/10.0.0.1:1978] -
[java] groupmgmt:SinglePhaseDisseminator: arriving - [[Paullaptop/10.0.0.1:1978]]
[java] groupmgmt:SinglePhaseDisseminator: departing - []
[java] groupmgmt:SinglePhaseDisseminator: Processing arriving - [Paullaptop/10.0.0.1:1978] connected to [Paullaptop/10.
0.0.1:1978]
[java] groupmgmt:SinglePhaseDisseminator: Starting to process arrival
[java] groupmgmt:SinglePhaseDisseminator: Just adding connection
[java] Lime:The waiter executed, index=2
[java] Lime:Entering main loop
[java] Lime:LTSMgr: SYSTEM inTransaction is true
[java] Lime:Tuple Space: SYSTEM waiting on transaction
[java] Lime:sending a message
[java] Lime:INCOMING_THREAD: Connection received
[java] Lime:INCOMING_MGR: Waiting for connection
[java] Lime:About to write
[java] Lime:INCOMING_THREAD: Received transaction op descriptor
[java] Lime:TransDescriptor: isTansDone: Begin method call
[java] Lime:Constructing a Lime TS Mgr called twee
[java] Lime:Entering main loop
[java] Lime:LTSMgr: twee inTransaction is true
[java] Lime:Tuple Space: twee waiting on transaction
[java] Lime:Reactor of TS SYSTEM: Running a reactive program with 0 reactions
[java] Lime:Reactor's contents for tsnamed: SYSTEM
[java] Lime:start following chain of reactions:
[java] Lime:done following chain of reactions:
[java] Lime:Reactor of TS SYSTEM: Running a reactive program with 0 reactions
[java] Lime:Reactor's contents for tsnamed: SYSTEM
[java] Lime:start following chain of reactions:
[java] Lime:done following chain of reactions:
[java] Lime:Reactor of TS SYSTEM: Running a reactive program with 0 reactions
[java] Lime:Reactor's contents for tsnamed: SYSTEM
[java] Lime:start following chain of reactions:
[java] Lime:done following chain of reactions:
[java] Lime:Reactor of TS twee: Running a reactive program with 0 reactions
[java] Lime:Reactor's contents for tsnamed: twee
[java] Lime:start following chain of reactions:
[java] Lime:done following chain of reactions:
[java] groupmgmt:GroupManager: Resuming updates
[java] groupmgmt:GroupManager: Updates resumed
[java] Lime:TupleSpace: SYSTEM no longer waiting on transaction
[java] Lime:Transaction completed in s = 62
[java] Lime:LTSM: SYSTEM waiting to get an operation to execute
[java] Lime:TupleSpace: twee no longer waiting on transaction
[java] TestAgent: true
[java] TestAgent: lts shared.
[java] Lime:Transaction completed in s = 31
[java] Lime:LTSM: twee waiting to get an operation to execute
[java] Lime:The waiter executed, index=2
[java] Lime:Entering main loop
[java] Lime:LTSMgr: twee inTransaction is false
[java] Lime:LTSM: twee waiting to get an operation to execute
[java] Lime:Received 1 descriptors from PAULLAPTOP:1743
[java] groupmgmt:SafeDistanceDetector: Discovered neighbor - [PaulHome/10.0.0.2:1973]
[java] groupmgmt:SinglePhaseDisseminator: Enqueing connections from [Paullaptop/10.0.0.1:1978] -
[java] groupmgmt:SinglePhaseDisseminator: arriving - [[PaulHome/10.0.0.2:1973]]
[java] groupmgmt:SinglePhaseDisseminator: departing - []
[java] groupmgmt:SinglePhaseDisseminator: Processing arriving - [Paullaptop/10.0.0.1:1978] connected to [PaulHome/10.0.
0.2:1973]
[java] groupmgmt:SinglePhaseDisseminator: Starting to process arrival
[java] groupmgmt:SinglePhaseDisseminator: Sending GetLeaderMessage to new Member - [PaulHome/10.0.0.2:1973]
[java] groupmgmt:SinglePhaseDisseminator: Got LeaderAddressMessage. Sending GroupInfoMessage
[java] groupmgmt:SinglePhaseDisseminator: Other leader is [PaulHome/10.0.0.2:1973]
[java] groupmgmt:SinglePhaseDisseminator: Got GroupChangeMessage. Firing GroupChangedEvent
[java] groupmgmt:SinglePhaseDisseminator: I'm a follower. Members = [[Paullaptop/10.0.0.1:1978], [PaulHome/10.0.0.2:197
3]]
[java] groupmgmt:SinglePhaseDisseminator: Finished engaging with [PaulHome/10.0.0.2:1973].
[java] groupmgmt:SinglePhaseDisseminator: ***GroupChangedEvent*** - [[Paullaptop/10.0.0.1:1978], [PaulHome/10.0.0.2:1973
]]
[java] groupmgmt:GroupManager: processing group changed event
[java] groupmgmt:GroupManager: This group is different, notify listeners
[java] groupmgmt:GroupManager: firing group changed event
[java] groupmgmt:GroupManager: updating 1 listeners
[java] Lime:---------------Adding: newGroupMembers contains me
[java] Lime:The waiter executed, index=2
[java] Lime:Entering main loop
[java] Lime:LTSMgr: twee inTransaction is true
[java] Lime:Tuple Space: twee waiting on transaction
[java] Lime:The waiter executed, index=2
[java] Lime:Entering main loop
[java] Lime:LTSMgr: SYSTEM inTransaction is true
[java] Lime:Tuple Space: SYSTEM waiting on transaction
[java] Lime:sending a message
[java] Lime:About to write
Any idea what I am doing wrong?? Please indicate if more information is needed.
Kind regards,
pkl
Admittedly I did not read all the output carefully, but the problem is likely the parameter "current" you are using in the rdp operation. You need to use either the AgentLocation (ID) of the host that wrote the tuple or the HostLocation where the writing agent is residing.
Another thing to try is a rd instead of a rdp. Use cur=unspecified in the rd. If this doesn't find the tuple, then there is a problem with connectivity of some sort.
If this doesn't help, try posting the out operation from Agent1 and your rdp operation from Agent2.
-Amy
Thank you very much (again) for you fast reply. I have seen it working now...
I must admit that I do not know why the LimeConsole sometimes crashes, but that doesn't matter (yet).
I have another small question about templates (e.g. rd with a template as arguments). How does this work? Is there any information about this other than that in the api?
Kind regards,
pkl
If you're asking how matching happens, I suggest reading the LightTS documentation. There is a link from the Lime web pages, or lights.sf.net.
The short answer is that a template is just a tuple with some of the fields formal. So, <string> matches <"foo">. You create templates just like you create tuples with LighTS, and the matches method is well described in the LighTS documentation.
-Amy
Thank you. The documentation was helpfull. However, I have another question:
I (finally) got it working, but when I shutdown one of my agents without calling the disengage method, the agent at the other host does not notice that the agent+limeserver are gone. This results in a SocketException when I execute a rdg on the tuplespace of the agent that is gone (of course, this is not so strange).
What I would like to know is whether there is a way to detect when an agent+limeserver are gone, without having to call the disengage method every time an agent leaves the community?
Kind regards,
pkl
Unfortunately, this behavior is the documented "correct" behavior. The version of Lime you are using EXPECTS announced disconnection. If a host does not announce its disconnection, the system does not recover from it.
We actually have another version of Lime that will be released in January. This new version is a rather complete re-work of Lime that handles the kind of un-announced disconnection that you are asking about.
If you want more details, send me an email and we can "chat" about it.
-Amy
amy.murphy@unisi.ch