commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicholas Byrd (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (IO-497) DeferredFileOutputStream produces unhandled IOExceptions if the java.io.tmpdir is deleted
Date Fri, 22 Jan 2016 20:06:40 GMT

     [ https://issues.apache.org/jira/browse/IO-497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nicholas Byrd updated IO-497:
-----------------------------
    Attachment: example_stack.txt
                dfos-bug-v2.tar.gz

@Sebb, I think you bring up a good point. I don't have any reason to believe that the entire
directory is being deleted, but it is definitely being cleared on a regular basis (deleting
all files and sub directories). Attached, you will find a "v2" of the test package which more
closely emulates this behavior. The exceptions still exist in these cases.

Additionally, I am attaching an example stack trace from our production application where
these issues started popping up. (Just for reference, the version of Spring-Web we're using
is 3.1.2-RELEASE; however the file management is still all being performed by Commons-FileUpload
and Commons-IO.)

> DeferredFileOutputStream produces unhandled IOExceptions if the java.io.tmpdir is deleted
> -----------------------------------------------------------------------------------------
>
>                 Key: IO-497
>                 URL: https://issues.apache.org/jira/browse/IO-497
>             Project: Commons IO
>          Issue Type: Bug
>          Components: Streams/Writers
>    Affects Versions: 2.4
>         Environment: unix-like operating systems where temporary disk storage is routinely
purged; CentOS specifically
>            Reporter: Nicholas Byrd
>         Attachments: dfos-bug-v2.tar.gz, dfos-bug.tar.gz, example_stack.txt
>
>
> In the event that the Java temporary directory is deleted prior to the DeferredFileOutputStream
trying to use it, the stream will throw one of two different IOExceptions (depending on how
the Stream was constructed). 
> This may sound like an unrealistic use-case at first, but it is legitimate as one of
my company's applications encountered it after the underlying operating system (CentOS) automatically
purged the contents of its tmp directory. (The application uses Commons FileUpload, which
invokes DeferredFileOutputStream and does not handle the error itself.) Our current work-around
is to restart the server when this happens, but we feel that the underlying library should
perhaps be intelligent enough to recover from such an error.
> Additionally, it seems an awkward experience that two different errors are produced based
on how the stream was constructed. One approach produces a FileNotFoundException while the
other produces a plain IOException. 
> A small maven project containing a single JUnit test that highlights the error will be
attached (see [dfos-bug.tar.gz|https://issues.apache.org/jira/secure/attachment/12783728/dfos-bug.tar.gz]).




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

Mime
View raw message