You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Raúl Kripalani (JIRA)" <ji...@apache.org> on 2016/04/06 21:06:25 UTC

[jira] [Comment Edited] (CAMEL-9826) MongoDB consumer could potentially block during shutdown

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

Raúl Kripalani edited comment on CAMEL-9826 at 4/6/16 7:06 PM:
---------------------------------------------------------------

Quick question. Have you seen this actually happening?
* The keepRunning flag is volatile.
* The cursor is closed by the shutdown thread, therefore the call to `cursor.hasNext()` in the while guard should unblock and either give an opportunity for the guard to evaluate the new value of keepRunning (false) or throw an exception (thus escaping the loop), unless there's a bug in the MongoDB driver and `cursor.hasNext()` never returns even when another thread has closed the cursor.



was (Author: raulvk):
Quick question. Have you seen this actually happening?
* The keepRunning flag is volatile.
* The cursor is closed by the shutdown thread, therefore the call to `cursor.hasNext()` in the while guard should unblock and either give an opportunity for the guard to evaluate the new value of keepRunning (false) or throw an exception, unless there's a bug in the MongoDB driver and `cursor.hasNext()` never returns even when another thread has closed the cursor.


> MongoDB consumer could potentially block during shutdown
> --------------------------------------------------------
>
>                 Key: CAMEL-9826
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9826
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-mongodb
>            Reporter: Claus Ibsen
>             Fix For: 2.18.0
>
>
> There is this endless while loop
> https://github.com/apache/camel/blob/master/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbTailingProcess.java#L132
> This should be using a CountDownLatch to await for the stop to complete so there is no endless while loop.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)