Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1936

FileCacheStore does not seem to close open files

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 5.1.3.FINAL
    • 5.1.2.FINAL
    • Core
    • None

      Using the following java (see Test.java):

      public static void main(String[] args) throws Exception {
      DefaultCacheManager manager = new DefaultCacheManager("config/config.xml");
      Cache<String, String> cache = manager.getCache("evictionCache");

      for (int i = 0; i < 10000; i++)

      { cache.put("key" + i, "value" + i); }

      cache.stop();
      manager.stop();
      }

      with the following config (see config.xml):

      <infinispan>
      <namedCache name="evictionCache">
      <loaders passivation="false" shared="false" preload="true">
      <loader class="org.infinispan.loaders.file.FileCacheStore"
      fetchPersistentState="true" ignoreModifications="false"
      purgeOnStartup="false">
      <properties>
      <property name="location" value="d:\code\infinispan\store" />
      </properties>
      </loader>
      </loaders>
      <eviction maxEntries="5000" strategy="LRU" />
      <expiration lifespan="60000" maxIdle="10000" wakeUpInterval="500" />
      </namedCache>
      </infinispan>

      running under Windows 7, there are two problems:

      1) There are lots INFO: Unable to remove empty file
      d:\code\infinispan\store\evictionCache-1134715904 - will try again
      later. I'm running under windows, so this may have something to do
      with it, but the process which is holding on to the file handles is
      the jvm. Is it possible that something somewhere is holding the files
      open somewhere? Looking at the code in FileCacheStore, there doesn't
      seem to be anything obvious.
      2) This may be related to the above, but the process eventually falls
      over with java.nio.channels.ClosedByInterruptException (with
      iterations = 1000) see console-1000.txt or a java.io.EOFException: The
      stream ended unexpectedly. for iterations = 10000 (see
      console-10000.txt).

        1. config.xml
          0.5 kB
        2. console-1000.out
          78 kB
        3. console-10000.out
          89 kB
        4. Test.java
          0.5 kB

              manik_jira Manik Surtani (Inactive)
              mfarwell_jira Matthew Farwell (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: