[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [certi-dev] Deadlock with jcerti
From: |
Jan-Patrick Osterloh |
Subject: |
Re: [certi-dev] Deadlock with jcerti |
Date: |
Tue, 09 Oct 2012 12:01:36 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 |
Hi,
--- Quoted from Jan-Patrick Osterloh (Date: 09.10.2012 10:43): ---
> Hi!
>
> --- Quoted from Eric Noulard (Date: 08.10.2012 21:27): ---
>> 2012/10/8 Jan-Patrick Osterloh <address@hidden>:
>> Concerning the debugging you should be able to debug into the call
>> but if it is racy may be debugging it would make the problem disappear...
>>
>> You may try to bump the logger trace level, that way we may
>> have more clue were the deadlock occurs.
>>
>> I don't remember right now how to do it.
>> May be something like defining the jcerti.logLevel to appropriate value is
>> the way to go. If you don't find your way in the Java code I'll find out
>> tomorrow.
>>
> I've seen somewhere that the debug level is read from a property file,
> I'll check that.
I'll managed to start the logger, by putting "certi.properties" in my
path, with LogLevel=10 as content. Here is the output (lines starting
with FED: is output from my tool):
FED: 1. Create federation - nofail
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Sending message (CREATE_FEDERATION_EXECUTION, NO_EXCEPTION,
federation time: null, federationName: offis_sim_control, FEDid:
C:\Programme\CERTI\share\federations\offis_sim_control.xml)
FED: 2. Join federation
lock try to aquire: 2. Join federation
lock aquired: 2. Join federation
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Received message (CREATE_FEDERATION_EXECUTION, NO_EXCEPTION,
federation time: null, federationName: offis_sim_control, FEDid:
C:\Programme\CERTI\share\federations\offis_sim_control.xml)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Sending message (JOIN_FEDERATION_EXECUTION, NO_EXCEPTION,
federation time: null, federate: 0, federationName: offis_sim_control,
federateName: client)
lock released: 2. Join federation
FED: 4. Initialise Control Simulation
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Received message (JOIN_FEDERATION_EXECUTION, NO_EXCEPTION,
federation time: null, federate: 1, federationName: offis_sim_control,
federateName: client)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Sending message (ENABLE_ATTRIBUTE_RELEVANCE_ADVISORY_SWITCH,
NO_EXCEPTION, federation time: null)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Received message (ENABLE_ATTRIBUTE_RELEVANCE_ADVISORY_SWITCH,
NO_EXCEPTION, federation time: null)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Sending message (ENABLE_CLASS_RELEVANCE_ADVISORY_SWITCH,
NO_EXCEPTION, federation time: null)
FED: lock try to aquire: 1
FED: lock aquired: 1
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Received message (ENABLE_CLASS_RELEVANCE_ADVISORY_SWITCH,
NO_EXCEPTION, federation time: null)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Sending message (GET_OBJECT_CLASS_HANDLE, NO_EXCEPTION, federation
time: null, objectClass: 0, className: IsAlive)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Received message (GET_OBJECT_CLASS_HANDLE, NO_EXCEPTION,
federation time: null, objectClass: 11, className: IsAlive)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Sending message (GET_ATTRIBUTE_HANDLE, NO_EXCEPTION, federation
time: null, objectClass: 11, attributeName: name, attribute: 0)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Received message (GET_ATTRIBUTE_HANDLE, NO_EXCEPTION, federation
time: null, objectClass: 11, attributeName: name, attribute: 2)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Sending message (GET_ATTRIBUTE_HANDLE, NO_EXCEPTION, federation
time: null, objectClass: 11, attributeName: type, attribute: 0)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Received message (GET_ATTRIBUTE_HANDLE, NO_EXCEPTION, federation
time: null, objectClass: 11, attributeName: type, attribute: 3)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Sending message (PUBLISH_OBJECT_CLASS, NO_EXCEPTION, federation
time: null, objectClass: 11, attributes: [2, 3])
FED: lock released: 1
FED: lock try to aquire: 2
FED: lock aquired: 2
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Received message (PUBLISH_OBJECT_CLASS, NO_EXCEPTION, federation
time: null, objectClass: 1, attributes: [])
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Sending message (REGISTER_OBJECT_INSTANCE, NO_EXCEPTION,
federation time: null, objectClass: 11, object: 0, objectName:
IsAliveObject_Test)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Received message (REGISTER_OBJECT_INSTANCE, NO_EXCEPTION,
federation time: null, objectClass: 11, object: 1, objectName: null)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Sending message (GET_OBJECT_CLASS_HANDLE, NO_EXCEPTION, federation
time: null, objectClass: 0, className: JoinSimulation)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Received message (GET_OBJECT_CLASS_HANDLE, NO_EXCEPTION,
federation time: null, objectClass: 9, className: JoinSimulation)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Sending message (GET_ATTRIBUTE_HANDLE, NO_EXCEPTION, federation
time: null, objectClass: 9, attributeName: toolName, attribute: 0)
FED: publish 1
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Received message (GET_ATTRIBUTE_HANDLE, NO_EXCEPTION, federation
time: null, objectClass: 9, attributeName: toolName, attribute: 2)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Sending message (GET_ATTRIBUTE_HANDLE, NO_EXCEPTION, federation
time: null, objectClass: 9, attributeName: status, attribute: 0)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Received message (GET_ATTRIBUTE_HANDLE, NO_EXCEPTION, federation
time: null, objectClass: 9, attributeName: status, attribute: 3)
09.10.2012 11:45:58 certi.rti.impl.CertiRtiAmbassador processRequest
INFO: Sending message (PUBLISH_OBJECT_CLASS, NO_EXCEPTION, federation
time: null, objectClass: 9, attributes: [2, 3])
The code belonging to this is:
...
RtiFactory factory =
RtiFactoryFactory.getRtiFactory();
rtia = factory.createRtiAmbassador();
info(" 1. Create federation - nofail");
File fom = new
File("C:\\Programme\\CERTI\\share\\federations\\offis_sim_control.xml");
aquireLock(null);
rtia.createFederationExecution("offis_sim_control", fom.toURI().toURL());
releaseLock(null);
running = true;
} catch (FederationExecutionAlreadyExists ex) {
running = true;
} catch (CouldNotOpenFED e) {
e.printStackTrace();
running = false;
} catch (ErrorReadingFED e) {
e.printStackTrace();
running = false;
} catch (MalformedURLException e) {
e.printStackTrace();
running = false;
} catch (RTIinternalError e) {
running = false;
} catch (ConcurrentAccessAttempted e) {
e.printStackTrace();
running = false;
}
if (!running) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
}
} while (!running);
info(" 2. Join federation");
aquireLock("2. Join federation");
rtia.joinFederationExecution("client",
"offis_sim_control", this);
releaseLock("2. Join federation");
info(" 4. Initialise Control Simulation");
rtia.enableAttributeRelevanceAdvisorySwitch();
rtia.enableClassRelevanceAdvisorySwitch();
keepAlive = new IsAlive(rtia, config.getPCName());
keepAlive.setName(config.getPCName());
keepAlive.setType("PC");
aquireLock("1");
keepAlive.publishSubscribeClass(true, false);
releaseLock("1");
js = new JoinSimulation(rtia, config.getPCName());
aquireLock("2");
js.publishSubscribeClass(true, false);
releaseLock("2");
SendConfigFile scf = new SendConfigFile(rtia, config.getPCName());
aquireLock("3");
scf.publishSubscribeClass(false, true);
classes.put(scf.getClassHandle(), scf);
releaseLock("3");
...
and the "js.publishSubscribeClass(true, false) code:
@Override
public void publishSubscribeClass(boolean publish, boolean
subscribe) throws NameNotFound,
FederateNotExecutionMember, RTIinternalError,
ObjectClassNotDefined {
try {
classHandle = rtia.getObjectClassHandle(className);
attrHandleToolName = rtia.getAttributeHandle("toolName",
classHandle);
attrHandleStatus = rtia.getAttributeHandle("status",
classHandle);
attributes =
RtiFactoryFactory.getRtiFactory().createAttributeHandleSet();
attributes.add(attrHandleToolName);
attributes.add(attrHandleStatus);
if (subscribe) {
rtia.subscribeObjectClassAttributes(classHandle,
attributes);
}
if (publish) {
System.out.println("publish 1");
rtia.publishObjectClass(classHandle, attributes);
System.out.println("publish 2");
myObject = rtia.registerObjectInstance(classHandle,
className + "Object_" + getGenPcName());
System.out.println("publish 3");
}
} catch (Exception e) {
e.printStackTrace();
}
}
and for completeness:
public static void aquireLock(String msg) {
if (msg != null)
System.out.println("lock try to aquire: " + msg);
lock.lock();
if (msg != null)
System.out.println("lock aquired: " + msg);
}
public static void releaseLock(String msg) {
lock.unlock();
if (msg != null)
System.out.println("lock released: " + msg);
}
Output of the RTIG:
0 0 0 3 9 0 Federation Name : offis_sim_control, Handle : 1, XML File :
C:\Programme\CERTI\share\federations\offis_sim_control.xml created. - OK
0 0 0 5 9 0 Federate "client" joins Federation
"offis_sim_control"(1)with handle 1. Socket 3876 - OK
0 1 1 87 6 0 ON - OK
0 1 1 85 6 68 ONCRA switch already enabled.
0 1 1 32 7 0 Publish Object Class = 11, # of att. = 2 - OK
0 1 1 42 6 0 Register Object Class = 11 - OK
0 0 0 3 9 0 Federation Name : offis_sim_control, Handle : 2 - OK
0 0 0 5 9 0 Federate "control" joins Federation
"offis_sim_control"(1)with handle 2. Socket 3852 - OK
0 1 2 87 6 0 ON - OK
0 1 2 85 6 68 ONCRA switch already enabled.
0 1 2 36 7 0 Subscribe Object Class = 10, # of att. = 2 - OK
0 1 2 36 7 0 Subscribe Object Class = 15, # of att. = 1 - OK
I'll generate RTIA output after lunch and send it, too.
JPO
--
Dipl. Inform. Jan-Patrick Osterloh
FuE Bereich Verkehr | R&D Division Transportation
Human Centered Design Group
OFFIS
FuE Bereich Verkehr | R&D Division Transport
Escherweg 2 - 26121 Oldenburg - Germany
Phone/Fax: +49 441 97 22-524/502
E-Mail: address@hidden
URL: http://www.offis.de
signature.asc
Description: OpenPGP digital signature
- [certi-dev] Deadlock with jcerti, Jan-Patrick Osterloh, 2012/10/08
- Re: [certi-dev] Deadlock with jcerti, Eric Noulard, 2012/10/08
- Re: [certi-dev] Deadlock with jcerti, Jan-Patrick Osterloh, 2012/10/09
- Re: [certi-dev] Deadlock with jcerti,
Jan-Patrick Osterloh <=
- Re: [certi-dev] Deadlock with jcerti, Jan-Patrick Osterloh, 2012/10/09
- Re: [certi-dev] Deadlock with jcerti, Andrej Pancik, 2012/10/10
- Re: [certi-dev] Deadlock with jcerti, Jan-Patrick Osterloh, 2012/10/11
- Re: [certi-dev] Deadlock with jcerti, Eric Noulard, 2012/10/12
- Re: [certi-dev] Deadlock with jcerti, Jan-Patrick Osterloh, 2012/10/12
- Re: [certi-dev] Deadlock with jcerti, Jan-Patrick Osterloh, 2012/10/15
- Re: [certi-dev] Deadlock with jcerti, Eric Noulard, 2012/10/15
- Re: [certi-dev] Deadlock with jcerti, Jan-Patrick Osterloh, 2012/10/15
- Re: [certi-dev] Deadlock with jcerti, Eric Noulard, 2012/10/16