Continuum
  1. Continuum
  2. CONTINUUM-1891

don't use default java.io.tmpdir for jetty bundle (can causes issues on solaris)

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.2.1
    • Component/s: Jetty Bundle
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      On solaris java.io.tmpdir is a shared directory (/var/tmp) and if different uid starts continuum. It can have some permissions issues.

      Caused by: net.sf.ehcache.CacheException: url-failures-cacheCache: Could not create disk store. Initial cause was Index file /var/tmp/url-failures-cache.index could not created.
              at net.sf.ehcache.store.DiskStore.<init>(DiskStore.java:164)
              at net.sf.ehcache.Cache.createDiskStore(Cache.java:577)
              at net.sf.ehcache.Cache.initialise(Cache.java:549)
              at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:707)
              at net.sf.ehcache.CacheManager.addCache(CacheManager.java:697)
              at net.sf.ehcache.CacheManager.addCache(CacheManager.java:654)
              at org.codehaus.plexus.cache.ehcache.EhcacheCache.initialize(EhcacheCache.java:244)
              at org.codehaus.plexus.spring.PlexusLifecycleBeanPostProcessor.postProcessAfterInitialization(PlexusLifecycleBeanPostProcessor.java:217)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:361)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.postProcessObjectFromFactoryBean(AbstractAutowireCapableBeanFactory.java:1427)
              at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:139)
              ... 56 more
      Caused by: java.io.IOException: Index file /var/tmp/url-failures-cache.index could not created.
              at net.sf.ehcache.store.DiskStore.createNewIndexFile(DiskStore.java:850)
              at net.sf.ehcache.store.DiskStore.readIndex(DiskStore.java:827)
              at net.sf.ehcache.store.DiskStore.initialiseFiles(DiskStore.java:193)
              at net.sf.ehcache.store.DiskStore.<init>(DiskStore.java:152)
              ... 66 more
      

        Activity

        Hide
        Olivier Lamy added a comment -

        fixed in rev 697231
        Now java.io.tmpdir is in $APP_BASE/tmp

        Show
        Olivier Lamy added a comment - fixed in rev 697231 Now java.io.tmpdir is in $APP_BASE/tmp
        Hide
        Wendy Smoak added a comment -

        Can you explain further? The temp directory provided by java is supposed to work. Are we using it incorrectly?

        Show
        Wendy Smoak added a comment - Can you explain further? The temp directory provided by java is supposed to work. Are we using it incorrectly?
        Hide
        Olivier Lamy added a comment -

        On solaris, it's a shared directory in /var/tmp for all users.
        If two different uid try to write a tmp file with the same name it will failed.
        In my case the stack trace says :

        Caused by: java.io.IOException: Index file /var/tmp/url-failures-cache.index could not created.
                at net.sf.ehcache.store.DiskStore.createNewIndexFile(DiskStore.java:850)
                at net.sf.ehcache.store.DiskStore.readIndex(DiskStore.java:827)
                at net.sf.ehcache.store.DiskStore.initialiseFiles(DiskStore.java:193)
        
        my uid is :
        bash-3.00$ id
        uid=3002(olamy) gid=10(staff)
        and
        bash-3.00$ ls -lrt /var/tmp/url-failures-cache.index
        -rw-r--r--   1 continuum staff        440 Aug  4 12:33 /var/tmp/url-failures-cache.index
        

        It's a normal use case. Tomcat does it and use -Djava.io.tmpdir="$CATALINA_TMPDIR" with CATALINA_TMPDIR="$CATALINA_BASE"/temp

        Show
        Olivier Lamy added a comment - On solaris, it's a shared directory in /var/tmp for all users. If two different uid try to write a tmp file with the same name it will failed. In my case the stack trace says : Caused by: java.io.IOException: Index file / var /tmp/url-failures-cache.index could not created. at net.sf.ehcache.store.DiskStore.createNewIndexFile(DiskStore.java:850) at net.sf.ehcache.store.DiskStore.readIndex(DiskStore.java:827) at net.sf.ehcache.store.DiskStore.initialiseFiles(DiskStore.java:193) my uid is : bash-3.00$ id uid=3002(olamy) gid=10(staff) and bash-3.00$ ls -lrt / var /tmp/url-failures-cache.index -rw-r--r-- 1 continuum staff 440 Aug 4 12:33 / var /tmp/url-failures-cache.index It's a normal use case. Tomcat does it and use -Djava.io.tmpdir="$CATALINA_TMPDIR" with CATALINA_TMPDIR="$CATALINA_BASE"/temp
        Hide
        Joakim Erdfelt added a comment -

        Commenting post-close just to add ... uhm ... comments.

        Managing java.io.tmpdir is almost a required aspect of handling concurrency issues when working on a
        shared work environment such as a build server or a unix platform.

        Example:

        a) You have multiple users on the same machine.
        b) Most of them are developers.
        c) The developers are all working with a bea-maven-plugin (or something similar) that performs some
        kind of task that uses the java.io.tmpdir to manage temporary files. However the implementation does
        not create a uniq and/or random file or directory.
        d) Developer 1 starts a long build using bea-maven-plugin
        e) Developer 2 starts another build also using bea-maven-plugin, however his run now starts to pick up on the temporary files
        that developer 1's instance of bea-maven-plugin is using.

        In our work to make a build farm and or concurrent builds on a single server, I think it would be wise to keep
        managing this variable, even on a per-project basis.

        Show
        Joakim Erdfelt added a comment - Commenting post-close just to add ... uhm ... comments. Managing java.io.tmpdir is almost a required aspect of handling concurrency issues when working on a shared work environment such as a build server or a unix platform. Example: a) You have multiple users on the same machine. b) Most of them are developers. c) The developers are all working with a bea-maven-plugin (or something similar) that performs some kind of task that uses the java.io.tmpdir to manage temporary files. However the implementation does not create a uniq and/or random file or directory. d) Developer 1 starts a long build using bea-maven-plugin e) Developer 2 starts another build also using bea-maven-plugin, however his run now starts to pick up on the temporary files that developer 1's instance of bea-maven-plugin is using. In our work to make a build farm and or concurrent builds on a single server, I think it would be wise to keep managing this variable, even on a per-project basis.

          People

          • Assignee:
            Olivier Lamy
            Reporter:
            Olivier Lamy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: