java - WatchService is unreliable on Linux -
i've been trying simple application of watchservice in java 7. watches directory new files. it's running on linux centos 6. can copy file watched directory , file create event. good.
i based upon oracle sample.
the problem key goes invalid inexplicably. javadoc says there several cases can cause this, such cancelling key. i'm not doing cancelling it. goes invalid while program running no file creation happening. sitting there , goes invalid in minutes or longer. 1 time ran 4 days before mysteriously went invalid.
the possible explanation javadoc watched directory deleted or no longer available. i'm not deleting it. leaves availability.
now wonder if linux implementation watchservice using tells directory unavailable because of system load or else. can't imagine this. system isn't loaded. filesystem containing directory local system. directory not used else.
what other possibilities?
Comments
Post a Comment