Github user markap14 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1580#discussion_r106460083
--- 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 --
@PuspenduBanerjee if we run out of usable space then it's true that we
won't be able to write to the content repository. As a result, processors will
fail if they try. However, this is a completely unrelated concern. This is
asking the repository how much space is available. This is used, for instance,
to show the information in the UI, so that the user knows what is going on. If
we throw an Exception here, now the user will be unable to see that there are 0
bytes available because an Exception is thrown so the HTTP request will return
a 500 HTTP status code.
---
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.
---