Github user PuspenduBanerjee commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1580#discussion_r106420146
--- Diff:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/FileSystemRepository.java
---
@@ -392,8 +399,11 @@ public long getContainerUsableSpace(String
containerName) throws IOException {
if (path == null) {
throw new IllegalArgumentException("No container exists with
name " + containerName);
}
-
- return Files.getFileStore(path).getUsableSpace();
+ long usableSpace=path.toFile().getUsableSpace();
+ if(usableSpace==0) {
+ throw new RuntimeException("System returned usable space of
the partition for " + containerName + " is zero byte. Nifi can not create a
zero sized FileSystemRepository");
--- End diff --
Hi @markap14 Let me place share the thought process that I have. As per my
understanding usableSpace==0 means the system is already at in deep trouble or
nothing is getting stored at your flow file repo. So, anyway we have faced
write/flush error and either handled that or couldn't. Which signifies that
checking or not checking zero usable space at this stage does not make any
practical difference.
Secondly, for a 1GB usable storage the chance of hitting that Runtime
exception is *1 in 1073741824* i.e. *9.31322575e-8%* .
This comment is applicable for all 3 queries/concerns.
If you still think that we need to care about it, I am in.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---