[Bug 64879] New: SXSSFSheet dispose() fails to remove Temporary files for java.io.IOException: No space left on device

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 64879] New: SXSSFSheet dispose() fails to remove Temporary files for java.io.IOException: No space left on device

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64879

            Bug ID: 64879
           Summary: SXSSFSheet dispose() fails to remove Temporary files
                    for java.io.IOException: No space left on device
           Product: POI
           Version: unspecified
          Hardware: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: SXSSF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

Created attachment 37549
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37549&action=edit
Exception stack trace

The SXSSFSheet has a bug where it will fail to delete the temporary file it has
created when the file system runs out of space.

I found this problem when creating a very large excel workbook using
SXSSFWorkbook. Attempting to write a new row fails (no space left), my code
then attempts to cleanup by calling dispose(). This fails because the workbook
attempts to flush before disposing and the flush fails with same IOException
(no space left). The large amount of disk space consumed by the temporary file
is only freed up when the program exits. I have attached a screenshot with the
stack trace.

Here is the code in question (poi-ooxml-4.1.2)

https://github.com/apache/poi/blob/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java#L1910

    boolean dispose() throws IOException {
        if (!allFlushed) {
            flushRows();
        }
        return _writer.dispose();
    }

I suggest this be changed so that the writer.dispose() is always called.

    boolean dispose() throws IOException {
        try {
            if (!allFlushed) {
                flushRows();
            }
        } finally {
            return _writer.dispose();
        }
    }

Let me know if you have any more questions.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64879] SXSSFSheet dispose() fails to remove Temporary files for java.io.IOException: No space left on device

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64879

Shawn Boyce <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
            Version|unspecified                 |4.1.2-FINAL

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64879] SXSSFSheet dispose() fails to remove Temporary files for java.io.IOException: No space left on device

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64879

--- Comment #1 from Shawn Boyce <[hidden email]> ---
Created attachment 37550
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37550&action=edit
SXSSFSheet patch

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64879] SXSSFSheet dispose() fails to remove Temporary files for java.io.IOException: No space left on device

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64879

--- Comment #2 from Shawn Boyce <[hidden email]> ---
Attached Patch file with slight change from my original suggestion

    boolean dispose() throws IOException {
        boolean ret;
        try {
            if (!allFlushed) {
                flushRows();
            }
        } finally {
            ret = _writer == null || _writer.dispose();
        }
        return ret;
    }

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 64879] SXSSFSheet dispose() fails to remove Temporary files for java.io.IOException: No space left on device

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=64879

PJ Fanning <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from PJ Fanning <[hidden email]> ---
merged with
https://github.com/apache/poi/commit/90a9288bfc024985dd2a42ea4f319a27bc305ee1
and
https://github.com/apache/poi/commit/578b71b127aa2da6f0f051973342790804aa705f

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]