[JBoss JIRA] (DROOLS-610) drools-worker-2 thread blocked and the main program blocks
by Nathalie ravenel (JIRA)
[ https://issues.jboss.org/browse/DROOLS-610?page=com.atlassian.jira.plugin... ]
Nathalie ravenel updated DROOLS-610:
------------------------------------
Attachment: image001.jpg
I will try this solution. In fact the function modifier_element can be called inside a rule. I understand the problem. Thanks you for the time dedicated. I will inform about the tests
De : Mario Fusco (JIRA) [mailto:issues@jboss.org]
Envoyé : jeudi 25 septembre 2014 09:29
À : RAVENEL Nathalie 161957
Objet : [JBoss JIRA] (DROOLS-610) drools-worker-2 thread blocked and the main program blocks
[Image supprimée par l'expéditeur.]
Mario Fusco<https://issues.jboss.org/secure/ViewProfile.jspa?name=mfusco> commented on [Bug] DROOLS-610<https://issues.jboss.org/browse/DROOLS-610>
Re: drools-worker-2 thread blocked and the main program blocks<https://issues.jboss.org/browse/DROOLS-610>
It's hard to tell just looking at that method and missing the big picture. If you want to keep using that method as it is from both your code and from inside a rule consequence I suggest to add a boolean to its list of arguments more or less as it follows:
public void modifier_element(String nom_slot, String valeur, boolean inConsequence) {
// do stuff
if (!inConsequence) {
this.session.fireAllRules();
}
// do other stuff
}
and invoke that method passing true when you call it from a consequence and false when you call it from your code.
Makes sense?
[Add Comment]<https://issues.jboss.org/browse/DROOLS-610#add-comment>
Add Comment<https://issues.jboss.org/browse/DROOLS-610#add-comment>
This message was sent by Atlassian JIRA (v6.3.1#6329-sha1:7df76f1)
[Atlassian logo]
> drools-worker-2 thread blocked and the main program blocks
> ----------------------------------------------------------
>
> Key: DROOLS-610
> URL: https://issues.jboss.org/browse/DROOLS-610
> Project: Drools
> Issue Type: Bug
> Affects Versions: 6.1.0.Final
> Environment: linux
> Reporter: Nathalie ravenel
> Assignee: Mario Fusco
> Attachments: blocked.PNG, drools-worker-2.PNG, image001.jpg, image001.jpg, main thread.PNG, pool-1-thread1.PNG
>
>
> Running our program, we got some deadlock on one thread (drools-worker-2). We investigated the problem using java memory control. The thread is blocked and the program also. The stack traces was registered for the different threads. The last trace for the thread was : org.drools.core.common.SynchronizedLeftTuplesSets.takeAll.
> There are 1111 Blocked count on one DeadLock on the thread.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 1 month
[JBoss JIRA] (DROOLS-610) drools-worker-2 thread blocked and the main program blocks
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-610?page=com.atlassian.jira.plugin... ]
Mario Fusco commented on DROOLS-610:
------------------------------------
It's hard to tell just looking at that method and missing the big picture. If you want to keep using that method as it is from both your code and from inside a rule consequence I suggest to add a boolean to its list of arguments more or less as it follows:
{code}
public void modifier_element(String nom_slot, String valeur, boolean inConsequence) {
// do stuff
if (!inConsequence) {
this.session.fireAllRules();
}
// do other stuff
}
{code}
and invoke that method passing true when you call it from a consequence and false when you call it from your code.
Makes sense?
> drools-worker-2 thread blocked and the main program blocks
> ----------------------------------------------------------
>
> Key: DROOLS-610
> URL: https://issues.jboss.org/browse/DROOLS-610
> Project: Drools
> Issue Type: Bug
> Affects Versions: 6.1.0.Final
> Environment: linux
> Reporter: Nathalie ravenel
> Assignee: Mario Fusco
> Attachments: blocked.PNG, drools-worker-2.PNG, image001.jpg, main thread.PNG, pool-1-thread1.PNG
>
>
> Running our program, we got some deadlock on one thread (drools-worker-2). We investigated the problem using java memory control. The thread is blocked and the program also. The stack traces was registered for the different threads. The last trace for the thread was : org.drools.core.common.SynchronizedLeftTuplesSets.takeAll.
> There are 1111 Blocked count on one DeadLock on the thread.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 1 month
[JBoss JIRA] (DROOLS-610) drools-worker-2 thread blocked and the main program blocks
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-610?page=com.atlassian.jira.plugin... ]
Mario Fusco resolved DROOLS-610.
--------------------------------
Resolution: Rejected
> drools-worker-2 thread blocked and the main program blocks
> ----------------------------------------------------------
>
> Key: DROOLS-610
> URL: https://issues.jboss.org/browse/DROOLS-610
> Project: Drools
> Issue Type: Bug
> Affects Versions: 6.1.0.Final
> Environment: linux
> Reporter: Nathalie ravenel
> Assignee: Mario Fusco
> Attachments: blocked.PNG, drools-worker-2.PNG, image001.jpg, main thread.PNG, pool-1-thread1.PNG
>
>
> Running our program, we got some deadlock on one thread (drools-worker-2). We investigated the problem using java memory control. The thread is blocked and the program also. The stack traces was registered for the different threads. The last trace for the thread was : org.drools.core.common.SynchronizedLeftTuplesSets.takeAll.
> There are 1111 Blocked count on one DeadLock on the thread.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 1 month
[JBoss JIRA] (DROOLS-610) drools-worker-2 thread blocked and the main program blocks
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-610?page=com.atlassian.jira.plugin... ]
Mario Fusco commented on DROOLS-610:
------------------------------------
Hi Nathalie,
either you do a fireAllRules inside that method OR you invoke the method from inside a consequence. What you have to avoid for sure is invoking fireAllRules during the execution of a consequence as you're doing at the moment.
I hope this helps,
Mario
> drools-worker-2 thread blocked and the main program blocks
> ----------------------------------------------------------
>
> Key: DROOLS-610
> URL: https://issues.jboss.org/browse/DROOLS-610
> Project: Drools
> Issue Type: Bug
> Affects Versions: 6.1.0.Final
> Environment: linux
> Reporter: Nathalie ravenel
> Assignee: Mario Fusco
> Attachments: blocked.PNG, drools-worker-2.PNG, image001.jpg, main thread.PNG, pool-1-thread1.PNG
>
>
> Running our program, we got some deadlock on one thread (drools-worker-2). We investigated the problem using java memory control. The thread is blocked and the program also. The stack traces was registered for the different threads. The last trace for the thread was : org.drools.core.common.SynchronizedLeftTuplesSets.takeAll.
> There are 1111 Blocked count on one DeadLock on the thread.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 1 month
[JBoss JIRA] (DROOLS-610) drools-worker-2 thread blocked and the main program blocks
by Nathalie ravenel (JIRA)
[ https://issues.jboss.org/browse/DROOLS-610?page=com.atlassian.jira.plugin... ]
Nathalie ravenel updated DROOLS-610:
------------------------------------
Attachment: image001.jpg
Dear Mario,
It is possible we don’t use correctly drools. We have a program what receives some events and updates the “working memory”. Inside the function modifier-element (to update the facthandle), we update the facthandle and after we fireAllRules. Please find below the corresponding java code.
We don’t have to fireAllRules ?
Nathalie
public void modifier_element(String nom_slot, String valeur) {
String tmp;
// on passe le nom en minuscule
nom_slot = nom_slot.toLowerCase();
//
if(debug)
//executer_commande("echo \""+nom_slot+": "+valeur+"\" >> ../debug/console.txt");
//System.out.println("Modifier element (str/str) : "+nom_slot+" valeur "+valeur);
try {
// on parcourt la liste de noms
for (String nom : listeDesNoms) {
// si le nom du slot contient le nom (ex : data_srv_1_choc contient data_srv_1)
//if(debug & nom_slot.contains("courant_commande")) System.out.println("Nom slot "+nom_slot+" valeurs:" +valeur+"\n");
if (nom_slot.contains(nom)) {
// be carefull element serveur_choc ... not dealed by this command
// find the element and the string attribute
tmpO = listeElements.get(nom);
tmp=tmpO.getString(nom_slot);
/*if (nom_slot.contains("_choc")) {
System.out.println("Element (str/str) "+nom_slot+" (initial/update) :"+tmp+" /"+valeur+"\n");
}*/
// si la valeur du slot est differente de l'ancienne
//if(debug) System.out.println("Nom associe str/str "+nom+" slot: "+nom_slot+" valeurs: "+tmp+ "/"+valeur+"\n");
if ( tmp == null || !tmp.equals(valeur)){
//if (!tmpO.getString(nom_slot).equals(valeur) ) {
// on recupere le factHandle relatif a l'objet
try{
tmpFH = listeFactHandle.get(tmpO.getNom());
}
catch(NullPointerException e){
System.err.println("erreur de recuperation dans le fact handle...");
}
// on modifie son attribut
tmpO.modifierAttributString(nom_slot, valeur);
// update memory
//this.session.update(listeFactHandle.get("myBool"), myBool );
this.session.update(tmpFH, tmpO);
this.session.fireAllRules();
//if(debug) System.out.println("Modifié en memoire (str) "+tmpO.getNom()+" slot: "+nom_slot+" valeur: "+valeur);
//if((debug)& (nom_slot.contains("courant"))) System.out.println("Fin modif (str) objet "+tmpO.getNom()+" slot: "+nom_slot+" valeur: "+valeur);
}
// pas propre mais gain de temps
break;
}
}
// si le nom est pas trouve on l'imprime a l'ecran
} catch (NullPointerException e) {
//if(!nom_slot.contains("_phase") & !nom_slot.contains("_seuil") & !nom_slot.contains("_color") & !nom_slot.contains("_left") & !nom_slot.contains("_right") & !nom_slot.contains("_middle")) {
if(debug) System.out.println("Objet non reference dans les slots (str): " + nom_slot+ " valeur "+valeur);
//}
}
// RAZ de elements temporaires
tmpO = null;
tmpFH = null;
}
De : Mario Fusco (JIRA) [mailto:issues@jboss.org]
Envoyé : mercredi 24 septembre 2014 19:56
À : RAVENEL Nathalie 161957
Objet : [JBoss JIRA] (DROOLS-610) drools-worker-2 thread blocked and the main program blocks
[Image supprimée par l'expéditeur.]
Mario Fusco<https://issues.jboss.org/secure/ViewProfile.jspa?name=mfusco> commented on [Bug] DROOLS-610<https://issues.jboss.org/browse/DROOLS-610>
Re: drools-worker-2 thread blocked and the main program blocks<https://issues.jboss.org/browse/DROOLS-610>
Nathalie,
for what I can see from the stack you attached, the deadlock is caused by the fact that you're misusing drools. In particular drools-worker-2.PNG shows that you're invoking a fireAllRules inside the execution of a drools consequence. For what I know this doesn't make any sense and I cannot see a valid reason for doing this, even because if a consequence is firing it means that you're already inside a fireAllRules.
Please let me know if you have a use case that requires to do this, so we could discuss it. Otherwise I'll close this ticket as invalid.
Cheers,
Mario
[Add Comment]<https://issues.jboss.org/browse/DROOLS-610#add-comment>
Add Comment<https://issues.jboss.org/browse/DROOLS-610#add-comment>
This message was sent by Atlassian JIRA (v6.3.1#6329-sha1:7df76f1)
[Atlassian logo]
> drools-worker-2 thread blocked and the main program blocks
> ----------------------------------------------------------
>
> Key: DROOLS-610
> URL: https://issues.jboss.org/browse/DROOLS-610
> Project: Drools
> Issue Type: Bug
> Affects Versions: 6.1.0.Final
> Environment: linux
> Reporter: Nathalie ravenel
> Assignee: Mario Fusco
> Attachments: blocked.PNG, drools-worker-2.PNG, image001.jpg, main thread.PNG, pool-1-thread1.PNG
>
>
> Running our program, we got some deadlock on one thread (drools-worker-2). We investigated the problem using java memory control. The thread is blocked and the program also. The stack traces was registered for the different threads. The last trace for the thread was : org.drools.core.common.SynchronizedLeftTuplesSets.takeAll.
> There are 1111 Blocked count on one DeadLock on the thread.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 1 month
[JBoss JIRA] (WFLY-1854) web-fragment.xml not loaded from a static module
by James Livingston (JIRA)
[ https://issues.jboss.org/browse/WFLY-1854?page=com.atlassian.jira.plugin.... ]
James Livingston commented on WFLY-1854:
----------------------------------------
The servlet spec also specifies that for TLD files, and we implemented support for loading them from modules in WFLY-1172, so perhaps we should consider doing the same for fragment descriptors.
> web-fragment.xml not loaded from a static module
> ------------------------------------------------
>
> Key: WFLY-1854
> URL: https://issues.jboss.org/browse/WFLY-1854
> Project: WildFly
> Issue Type: Feature Request
> Components: Web (Undertow)
> Affects Versions: 8.0.0.Alpha3
> Reporter: Marek Schmidt
> Fix For: Awaiting Volunteers
>
> Attachments: WFLY-1854.tar
>
>
> Having a custom static module, e.g. org/jboss/solder which contains solder.jar with META-INF/web-fragment.xml with some filters defined (e.g. CatchExceptionFilter)
> and a WAR application, e.g. catch-basic-servlet (on of Solder examples) with jboss-deployment-structure.xml such as
> {code}
> <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
> <deployment>
> <dependencies>
> <module name="org.jboss.solder" meta-inf="import"/>
> </dependencies>
> </deployment>
> </jboss-deployment-structure>
> {code}
> The filters defined in the solder's web-fragment.xml don't seem to work, while the same app works fine if the solder.jar is deployed in the WAR in the WEB-INF/lib instead of a static module.
> People seem to assume that whatever works for WEB-INF/lib would also work for a static module. This assumption should either be fulfilled or clearly explained to people if it doesn't hold.
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
10 years, 1 month