GitHub user hangc0276 opened a pull request:

    https://github.com/apache/flume/pull/114

    "idleFuture" should reset to "null" after idle bucket closed

    If we use "idleTimeout" to roll file, once the flush() method called, it 
will start a delayed thread to close the idle bucketWriter. The delayed thread 
will call close() method to check whether the "idleFuture" is done, and close 
opened file. If the "idleFuture" is running when checking, the 
idleFuture.isDone() method will return false, and the idleFuture won't be set 
to "null". When the bucketWriter calls flush() on the next time, the 
"idleFuture" is not "null" and idleFutrue.cancel(false) method returns false 
due to the "idleFuture" has completed in the last call. So new thread won't be 
created to close current idle bucketWriter and keeps current file openning.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/hangc0276/flume trunk

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flume/pull/114.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #114
    
----
commit f4ff97ddb64e82b105057359ab7724f824e346d5
Author: hangc0276 <hangc0...@163.com>
Date:   2017-03-09T07:57:16Z

    "idleFuture" should reset to "null" after idle bucket closed
    
    If we use "idleTimeout" to roll file, once the flush() method called, it 
will start a delayed thread to close the idle bucketWriter. The delayed thread 
will call close() method to check whether the "idleFuture" is done, and close 
opened file. If the "idleFuture" is running when checking, the 
idleFuture.isDone() method will return false, and the idleFuture won't be set 
to "null". When the bucketWriter calls flush() on the next time, the 
"idleFuture" is not "null" and idleFutrue.cancel(false) method returns false 
due to the "idleFuture" has completed in the last call. So new thread won't be 
created to close current idle bucketWriter and keeps current file openning.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to