Uploaded image for project: 'Spring for Apache Hadoop'
  1. Spring for Apache Hadoop
  2. SHDP-474

Race condition when enabling/disabling SystemExitCall in abstract class ExecutionUtils

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.0 RC1
    • Fix Version/s: None
    • Component/s: Batch, MR
    • Labels:
      None
    • Environment:
      N/A

      Description

      Running multiple steps/ flows in parallel will cause a race condition when trying to set/ revert the Security Manager to prevent the JVM from exiting.

      This can cause the JVM to hang and not exit gracefully.

      Code block to elaborate

      private static SecurityManager oldSM = null;
      static void disableSystemExitCall() {
      final SecurityManager securityManager = new SecurityManager() {
      @Override
      public void checkPermission(Permission permission) {
      String name = permission.getName();
      if (name.startsWith("exitVM")) {
      throw new ExitTrapped(name);
      }
      }
      };
      oldSM = System.getSecurityManager();
      System.setSecurityManager(securityManager);
      }
      static void enableSystemExitCall() {
      System.setSecurityManager(oldSM);
      }
      

        Attachments

          Activity

            People

            Assignee:
            thomas.risberg Thomas Risberg
            Reporter:
            asgard Walter Morykon
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: