Tikal export tmx not closing input stream

Issue #849 closed
Former user created an issue

I just find out that the operation -exp is not closing the input stream. I'm running a program that exports a tmx from a pensieve tm, the point is that after that I want to delete the folder but okapi is leaving the input stream open so I can't close it. Does anyone had the same problem or is there any solution to this?

Comments (2)

  1. Mihai Nita

    I cannot detect any problem in this area.

    Can you please share the command line? OS? JVM version? Check the Okapi version again, making sure it is M37? Anything else you can think of?


    This is what I did (using these parameters for tikal: -exp tmDirectory -sl en -tl fr)

    1. I’ve done several runs under Eclipse, with breakpoints in the file manipulation ares (open / close readers and writers, filters, RawDocuments, RawDocumentToFilterEventsStep.handleEvent, FilterEventsToRawDocumentStep.handleEvent)

    I’ve also added print statements in the open / close areas.

    Everything looked normal.

    2. I’ve used strace on Linux while running tikal.sh -exp tmDirectory -sl en -tl fr

    Complete command:
    strace -f -e trace=open,close,read,write,connect,accept ./tikal.sh -exp tmDirectory -sl en -tl fr 2> strace.log

    Then I've analysed the operations in strace.log all open / close operations. And they all seem to pair nicely.


    But there might be a flag that results in a different code path.

    Or it might be that some “close” operations are done automatically by the JVM when cleaning up, not by Okapi code.
    So in that there might be OS differences, or JVM differences.

    I know that there are some problems with Java on Windows, see for instance:
    https://bugs.openjdk.java.net/browse/JDK-8190526

    And I also know about problems on Windows when trying to remove temp files too fast after close (and working after a short delay, seems like some caching problem)


    Thank you very much,
    Mihai

  2. Log in to comment