[Bug 62012] New: Disposing POI temporary files in multithreaded system

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

[Bug 62012] New: Disposing POI temporary files in multithreaded system

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

            Bug ID: 62012
           Summary: Disposing POI temporary files in multithreaded system
           Product: POI
           Version: 3.17-FINAL
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: XSSF
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

Hi,
I'm using POI SXSSFWorkbook for creating XLSX files in multithreaded system.
Since i read that there are issues with disposing the temporary files in when
using the DefaultTempFileCreationStrategy (with poifiles directory), i created
each thread is own temporary directory:

private TempFileCreationStrategy createTempFileCreationStrategy(File
poiTempFileDirectory) {
        return new TempFileCreationStrategy() {
            @Override
            public File createTempFile(String prefix, String suffix) throws
IOException {
                if (!poiTempFileDirectory.exists()) {
                    poiTempFileDirectory.mkdir();
                }
                File newFile = File.createTempFile(prefix, suffix,
poiTempFileDirectory);
                return newFile;
            }

            @Override
            public File createTempDirectory(String prefix) throws IOException {
                return null;
            }
        };


This is the code while finishing handling the SXSSFWorkbook object:

       // Write the Stream and close it
        workBook.write(outputStream);

            outputStream.close();

        } catch (FileNotFoundException e) {
            throw e;
        } catch (IOException e) {
            throw e;
        } catch (Exception e) {
            throw e;
        } finally {
            //Close the workBook
            workBook.close();
            //deleting the temporary files
            workBook.dispose();
        }

But still, from time to time, i'm getting an exception during the dispose. One
thread is throwing exception while trying to delete the temporary files of
another thread and the message is:
"dc319a2c-a663-4cb7-9f13-f7e8cc14c186/poi-sxssf-sheet-xml6608967316211277648.gz
(No such file or directory)"

Thanks in advanced

--
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 62012] Disposing POI temporary files in multithreaded system

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

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
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 62012] Disposing POI temporary files in multithreaded system

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=62012

Dominik Stadler <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Dominik Stadler <[hidden email]> ---
Can you post the full stacktrace to let us see where exactly this happens?

--
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 62012] Disposing POI temporary files in multithreaded system

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=62012

--- Comment #2 from [hidden email] ---
Hi Dominik,
I'm getting this exception very rarely, (around every 1,000 usings), i'm trying
to get the stack trace. The moment i'll get it, i'll send it to you.

Thanks
Yaniv

--
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 62012] Disposing POI temporary files in multithreaded system

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=62012

Stefan Thurnherr <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
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 62012] Disposing POI temporary files in multithreaded system

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=62012

--- Comment #3 from PJ Fanning <[hidden email]> ---
Is it possible that some external process is reaping files from the temp
directory?
In my applications, I try to use an explicit java.io.tmpdir to avoid using
/tmp. I have multi-threaded apps using POI and have not hit issues with temp
files being deleted while they are still in use.

--
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]