CogComp / cogcomp-nlpy

CogComp's light-weight Python NLP annotators
http://nlp.cogcomp.org/
Other
116 stars 26 forks source link

Remove the temporary cache folders created by MapDB before running local pipeline #31

Open GHLgh opened 7 years ago

GHLgh commented 7 years ago

When I am testing the code, sometime it will throw out the following exception JVM exception occurred: Header checksum broken. Store was not closed correctly, or is corrupted when I initialize local pipeline. And it can be solved by removing the annotation-cache file refer to pipeline's documentation

Should I check and remove the file before initializing local pipeline, or there is another way to solve it? @danyaljj @bhargav

danyaljj commented 7 years ago

What version of the pipeline are we using?

GHLgh commented 7 years ago

3.1.1

danyaljj commented 7 years ago

The quick fix is to delete the cache, but it's not a good option. The other (probably better) fix is to set transaction for the pipeline cache, just like how we did it for the client: https://github.com/CogComp/cogcomp-nlp/pull/392

bhargav commented 7 years ago

This also happened to Pavan a lot. Most time the JVM is not closed properly which causes this issue. One workaround is to have pipeline methods wrapped with a with-statement so that we can programmatically showdown the JVM. https://docs.python.org/2/library/contextlib.html