You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Freeman Yue Fang (Jira)" <ji...@apache.org> on 2020/04/16 17:10:00 UTC

[jira] [Comment Edited] (CXF-8259) Blocked thread of JMS transport during jboss shutdown

    [ https://issues.apache.org/jira/browse/CXF-8259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17085105#comment-17085105 ] 

Freeman Yue Fang edited comment on CXF-8259 at 4/16/20, 5:09 PM:
-----------------------------------------------------------------

Hi [~reta],

Thanks for looking into this.

Probably we can simply move the synchronized keyword from the whole restartConnection method to the code block to createTargetDestinationListener. Like this
{code}
-    protected synchronized void restartConnection() {
+    protected void restartConnection() {
         int tries = 0;
         do {
             tries++;
             try {
-                deactivate();
-                this.jmsListener = createTargetDestinationListener();
-                LOG.log(Level.INFO, "Established JMS connection");
+                synchronized (this) {
+                    deactivate();
+                    this.jmsListener = createTargetDestinationListener();
+                    LOG.log(Level.INFO, "Established JMS connection");
+                }
             } catch (Exception e1) {
{code}
So this method won't hold the lock forever in indefinite while loop.

Best Regards
Freeman


was (Author: ffang):
Hi [~reta],

Thanks for looking into this.

Probably we can simply move the synchronized keyword from the whole restartConnection method to the code block to createTargetDestinationListener. Like this
{code}
-    protected synchronized void restartConnection() {
+    protected void restartConnection() {
         int tries = 0;
         do {
             tries++;
             try {
-                deactivate();
-                this.jmsListener = createTargetDestinationListener();
-                LOG.log(Level.INFO, "Established JMS connection");
+                synchronized (this) {
+                    deactivate();
+                    this.jmsListener = createTargetDestinationListener();
+                    LOG.log(Level.INFO, "Established JMS connection");
+                }
             } catch (Exception e1) {
{code}

Best Regards
Freeman

> Blocked thread of JMS transport during jboss shutdown
> -----------------------------------------------------
>
>                 Key: CXF-8259
>                 URL: https://issues.apache.org/jira/browse/CXF-8259
>             Project: CXF
>          Issue Type: Bug
>          Components: JMS
>    Affects Versions: 3.3.5, 3.3.6
>            Reporter: Alessandro Proscia
>            Assignee: Andriy Redko
>            Priority: Major
>         Attachments: jboss.log
>
>
> We have a soap over jms webservice implemented with a camel route (Camel 3.2.0) and CXF that uses activemq as message broker. The webservice is deployed on a jboss eap 7.1 with jdk 1.8. Following the CXF upgrade from version 3.3.4 to 3.3.5 (and also with 3.3.6), jboss hangs on shutdown due to a blocking thread of CXF:
> "ServerService Thread Pool – 82" #231 prio=5 os_prio=0 tid=0x0000000002981800 nid=0x66d2 waiting for monitor entry [0x00007f0d60d2f000]
>  java.lang.Thread.State: BLOCKED (on object monitor)
>  at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:42)
> Therefore, we can have to kill the Jboss process to complete the shutdown.
>  The connection to activemq is managed by a resource adapter on jboss. Url is configured with a failover as follows:
> failover://(tcp://amqdev.internal:61616,tcp://amqdev.internal:61616,tcp://amqdev.internal:61616)?timeout=1000&initialReconnectDelay=2000&maxReconnectAttempts=2
> Attached you can find the thread dump taken from logs.
>   
>   



--
This message was sent by Atlassian Jira
(v8.3.4#803005)