You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/05/15 09:07:00 UTC

[jira] [Work logged] (CAMEL-13466) DefaultCamelContext not stopping all routes on doStop()

     [ https://issues.apache.org/jira/browse/CAMEL-13466?focusedWorklogId=242354&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-242354 ]

ASF GitHub Bot logged work on CAMEL-13466:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/May/19 09:06
            Start Date: 15/May/19 09:06
    Worklog Time Spent: 10m 
      Work Description: jbonofre commented on pull request #2917: [CAMEL-13466] Fully populate (including routes which failed to start) routes to be stopped in the CamelContext
URL: https://github.com/apache/camel/pull/2917
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 242354)
            Time Spent: 10m
    Remaining Estimate: 0h

> DefaultCamelContext not stopping all routes on doStop()
> -------------------------------------------------------
>
>                 Key: CAMEL-13466
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13466
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.20.1
>            Reporter: Julien Greffe
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: 2.23.3, 2.22.5, 2.24.1
>
>         Attachments: sample-dozer-route-2.0.0-SNAPSHOT.jar
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hello,
> after applying CAMEL-12980,
> we're still facing an issue with a failing starting feature and the CXFServlet {{/services}} URL.
>  
> To reproduce :
>  * drop the attached JAR in deploy
>  * wait for bundle start and failure
>  * access {{/services}} URL : endpoint + WSDL are listed > is this an expected behaviour?
>  
>  For further analysis, it seems to be something missing in camel-core :
> When blueprint fails, the {{doStop()}} method is called :
>  [https://github.com/apache/camel/blob/camel-2.20.1/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java#L3506]
>  At that line, it tries to stop only the routes already started, but not the ones failing *before* filling {{routeStartupOrder}} List.
>  [https://github.com/apache/camel/blob/camel-2.20.1/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java#L4041]
> One of this routes is a CxfConsumer which has already been instanciated, with a server creation :
>  [https://github.com/apache/camel/blob/camel-2.20.1/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java#L69]
> Even with {{DefaultCamelContext.doStop()}}, the server is still started and available in {{/services}}.
> Tried a fix by adding this line in DefaultCamelContext:3502 :
> {code:java}
> // fill all the routes to be stopped
> getRouteStartupOrder().addAll(routeServices.values().stream().map(this::doPrepareRouteToBeStarted).collect(Collectors.toList()));
> // stop route inputs in the same order as they was started so we stop the very first inputs first
>  try {
>  // force shutting down routes as they may otherwise cause shutdown to hang
> ...
> {code}
> And now the endpoint isn't available anymore.
>  But this fix isn't effective enough as {{getRouteStartupOrder()}} may have duplicates?
> Thanks,



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)