Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-166

Clearing server environment in bootstrap breaks embedded server restart

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • 8.0.0.CR1
    • None
    • Server
    • None

      Recursively deleting tmp directories as part of Bootstrap.bootstrap() prevents multiple embedded server restarts. I believe it has to do with how directories are crated as part of static VFS initialisation.

      TempFileProvider has this static code

          static {
              String configTmpDir = System.getProperty(JBOSS_TMP_DIR_PROPERTY);
              if (configTmpDir == null)
                  configTmpDir = System.getProperty(JVM_TMP_DIR_PROPERTY);
              try {
                  TMP_ROOT = new File(configTmpDir, "vfs");
                  TMP_ROOT.mkdirs();
              }
              catch (Exception e) {
                  throw new RuntimeException("Can't set up temp file provider", e);
              }
          }
      

      which creates the vfs directory only once that this patch removes. As a consequence on server restart with jboss-vfs on the boot classpath hte vfs directory is missing an no tmp file can be created.

      Generally, the server should only remove state on shutdown that it creates itself on startup/run. Alternatively, jboss-vfs should support a start/stop lifecycle in the TempFileProvider and possibly in other entities that also use static initialisers.

            rhn-cservice-bbaranow Bartosz Baranowski
            tdiesler@redhat.com Thomas Diesler
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: