[
https://issues.apache.org/jira/browse/FLUME-2285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14565949#comment-14565949
]
yinghua_zh commented on FLUME-2285:
-----------------------------------
I have found the reason:the file channel starting will check the disk space,if
the disk space is not enough,it sets the open flag to be false,the FileChannel
start method code as follow:
public synchronized void start() {
LOG.info("Starting {}...", this);
try {
Builder builder = new Log.Builder();
...............
log.replay();
open = true;
int depth = getDepth();
Preconditions.checkState(queueRemaining.tryAcquire(depth),
"Unable to acquire " + depth + " permits " + channelNameDescriptor);
LOG.info("Queue Size after replay: " + depth + " "
+ channelNameDescriptor);
} catch (Throwable t) {
open = false;
startupError = t;
LOG.error("Failed to start the file channel " + channelNameDescriptor, t);
if (t instanceof Error) {
throw (Error) t;
}
}
log.replay() method invoke writeCheckpoint method,and then if the disk space is
not enough,FileChannel start failed,and the startupError value is "Caused
by: java.io.IOException: Usable space exhaused, only 1....",when the sink get
data from the channel,the open flag is false,will print the disk is not enough
even if the disk space is enough. But if the file channel start successfully
and the disk sapace is not enough,the problem can not occur.
> FileChannel Erroneously Reports "Usable Space Exhausted"
> --------------------------------------------------------
>
> Key: FLUME-2285
> URL: https://issues.apache.org/jira/browse/FLUME-2285
> Project: Flume
> Issue Type: Bug
> Affects Versions: v1.4.0
> Reporter: Michael Knapp
>
> I am using Flume 1.4.0, my configuration has a file channel with all of the
> default settings. It's checkpoint directory and data directory are both
> empty and have the correct permissions on them. When I run flume I get this
> exception:
> java.lang.IllegalStateException: Channel closed [...]. Due to
> java.io.IOException: Usable space exhaused, only 99401728 bytes remaining,
> required 524288000 bytes
> The drive that the checkpoint and data directories reside on has 86GB
> available (unused) on it. The flume application is calculating the wrong
> number for usable space.
> If I am wrong here, then the exception message should at least be more clear,
> describing how to fix the issue, and where exactly it is getting that number
> (99401728 bytes). It would also be nice if the numbers were reported in
> human readable form (MB, GB, etc.)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)