Uploaded image for project: 'Oozie'
  1. Oozie
  2. OOZIE-3688

Introduce retry mechanism when starting embedded servlet containers in unit tests

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.2.1
    • 5.3.0
    • None
    • None

    Description

      In the unit tests which uses the embedded servlet container an intermittent issue can occur without this change, because those tests start the container on a specific port, which is available at the start of the unit tests. However, in some corner cases, it can happen that the port is being available at the start of the test, but some process occupies that port meanwhile, leading to a `java.net.BindException: Address already in use` exception during the unit test's execution.

      The goal of this ticket is resolve this by introducing a retry mechanism when starting the embedded servlet container.

      Attachments

        1. OOZIE-3688-001.patch
          3 kB
          János Makai

        Activity

          hadoopci Hadoop QA added a comment -

          PreCommit-OOZIE-Build started

          hadoopci Hadoop QA added a comment - PreCommit-OOZIE-Build started
          hadoopci Hadoop QA added a comment -

          Testing JIRA OOZIE-3688

          Cleaning local git workspace

          ----------------------------

          +1 PATCH_APPLIES
          +1 CLEAN
          +1 RAW_PATCH_ANALYSIS
          . +1 the patch does not introduce any @author tags
          . +1 the patch does not introduce any tabs
          . +1 the patch does not introduce any trailing spaces
          . +1 the patch does not introduce any star imports
          . +1 the patch does not introduce any line longer than 132
          . +1 the patch adds/modifies 1 testcase(s)
          +1 RAT
          . +1 the patch does not seem to introduce new RAT warnings
          +1 JAVADOC
          . +1 Javadoc generation succeeded with the patch
          . +1 the patch does not seem to introduce new Javadoc warning(s)
          +1 COMPILE
          . +1 HEAD compiles
          . +1 patch compiles
          . +1 the patch does not seem to introduce new javac warnings
          -1 There are [8] new bugs found below threshold in total that must be fixed.
          . -1 There are [7] new bugs found below threshold in [core] that must be fixed, listing only the first [5] ones.
          . You can find the SpotBugs diff here (look for the red and orange ones): core/findbugs-new.html
          . The top [5] most important SpotBugs errors are:
          . At BulkJPAExecutor.java:[line 206]: This use of javax/persistence/EntityManager.createQuery(Ljava/lang/String;)Ljavax/persistence/Query; can be vulnerable to SQL/JPQL injection
          . At BulkJPAExecutor.java:[line 176]: At BulkJPAExecutor.java:[line 175]
          . At BulkJPAExecutor.java:[line 205]: At BulkJPAExecutor.java:[line 199]
          . This use of javax/persistence/EntityManager.createQuery(Ljava/lang/String;)Ljavax/persistence/Query; can be vulnerable to SQL/JPQL injection: At BulkJPAExecutor.java:[line 206]
          . At BulkJPAExecutor.java:[line 111]: At BulkJPAExecutor.java:[line 127]
          . +1 There are no new bugs found in [client].
          . +1 There are no new bugs found in [docs].
          . +1 There are no new bugs found in [fluent-job/fluent-job-api].
          . 0 There are [4] new bugs found in [server] that would be nice to have fixed.
          . You can find the SpotBugs diff here: server/findbugs-new.html
          . +1 There are no new bugs found in [examples].
          . +1 There are no new bugs found in [tools].
          . +1 There are no new bugs found in [webapp].
          . +1 There are no new bugs found in [sharelib/distcp].
          . +1 There are no new bugs found in [sharelib/spark].
          . -1 There are [1] new bugs found below threshold in [sharelib/oozie] that must be fixed.
          . You can find the SpotBugs diff here (look for the red and orange ones): sharelib/oozie/findbugs-new.html
          . The most important SpotBugs errors are:
          . At ShellMain.java:[line 93]: This usage of java/lang/ProcessBuilder.<init>(Ljava/util/List;)V can be vulnerable to Command Injection
          . At ShellMain.java:[line 91]: At ShellMain.java:[line 90]
          . At ShellMain.java:[line 92]
          . +1 There are no new bugs found in [sharelib/hcatalog].
          . +1 There are no new bugs found in [sharelib/streaming].
          . +1 There are no new bugs found in [sharelib/hive2].
          . +1 There are no new bugs found in [sharelib/sqoop].
          . +1 There are no new bugs found in [sharelib/hive].
          . +1 There are no new bugs found in [sharelib/pig].
          . +1 There are no new bugs found in [sharelib/git].
          +1 BACKWARDS_COMPATIBILITY
          . +1 the patch does not change any JPA Entity/Colum/Basic/Lob/Transient annotations
          . +1 the patch does not modify JPA files
          +1 TESTS
          . Tests run: 3259
          +1 DISTRO
          . +1 distro tarball builds with the patch
          +1 MODERNIZER

          ----------------------------
          -1 Overall result, please check the reported -1(s)

          The full output of the test-patch run is available at

          . https://ci-hadoop.apache.org/job/PreCommit-OOZIE-Build/170/

          hadoopci Hadoop QA added a comment - Testing JIRA OOZIE-3688 Cleaning local git workspace ---------------------------- +1 PATCH_APPLIES +1 CLEAN +1 RAW_PATCH_ANALYSIS . +1 the patch does not introduce any @author tags . +1 the patch does not introduce any tabs . +1 the patch does not introduce any trailing spaces . +1 the patch does not introduce any star imports . +1 the patch does not introduce any line longer than 132 . +1 the patch adds/modifies 1 testcase(s) +1 RAT . +1 the patch does not seem to introduce new RAT warnings +1 JAVADOC . +1 Javadoc generation succeeded with the patch . +1 the patch does not seem to introduce new Javadoc warning(s) +1 COMPILE . +1 HEAD compiles . +1 patch compiles . +1 the patch does not seem to introduce new javac warnings -1 There are [8] new bugs found below threshold in total that must be fixed. . -1 There are [7] new bugs found below threshold in [core] that must be fixed, listing only the first [5] ones. . You can find the SpotBugs diff here (look for the red and orange ones): core/findbugs-new.html . The top [5] most important SpotBugs errors are: . At BulkJPAExecutor.java: [line 206] : This use of javax/persistence/EntityManager.createQuery(Ljava/lang/String;)Ljavax/persistence/Query; can be vulnerable to SQL/JPQL injection . At BulkJPAExecutor.java: [line 176] : At BulkJPAExecutor.java: [line 175] . At BulkJPAExecutor.java: [line 205] : At BulkJPAExecutor.java: [line 199] . This use of javax/persistence/EntityManager.createQuery(Ljava/lang/String;)Ljavax/persistence/Query; can be vulnerable to SQL/JPQL injection: At BulkJPAExecutor.java: [line 206] . At BulkJPAExecutor.java: [line 111] : At BulkJPAExecutor.java: [line 127] . +1 There are no new bugs found in [client] . . +1 There are no new bugs found in [docs] . . +1 There are no new bugs found in [fluent-job/fluent-job-api] . . 0 There are [4] new bugs found in [server] that would be nice to have fixed. . You can find the SpotBugs diff here: server/findbugs-new.html . +1 There are no new bugs found in [examples] . . +1 There are no new bugs found in [tools] . . +1 There are no new bugs found in [webapp] . . +1 There are no new bugs found in [sharelib/distcp] . . +1 There are no new bugs found in [sharelib/spark] . . -1 There are [1] new bugs found below threshold in [sharelib/oozie] that must be fixed. . You can find the SpotBugs diff here (look for the red and orange ones): sharelib/oozie/findbugs-new.html . The most important SpotBugs errors are: . At ShellMain.java: [line 93] : This usage of java/lang/ProcessBuilder.<init>(Ljava/util/List;)V can be vulnerable to Command Injection . At ShellMain.java: [line 91] : At ShellMain.java: [line 90] . At ShellMain.java: [line 92] . +1 There are no new bugs found in [sharelib/hcatalog] . . +1 There are no new bugs found in [sharelib/streaming] . . +1 There are no new bugs found in [sharelib/hive2] . . +1 There are no new bugs found in [sharelib/sqoop] . . +1 There are no new bugs found in [sharelib/hive] . . +1 There are no new bugs found in [sharelib/pig] . . +1 There are no new bugs found in [sharelib/git] . +1 BACKWARDS_COMPATIBILITY . +1 the patch does not change any JPA Entity/Colum/Basic/Lob/Transient annotations . +1 the patch does not modify JPA files +1 TESTS . Tests run: 3259 +1 DISTRO . +1 distro tarball builds with the patch +1 MODERNIZER ---------------------------- -1 Overall result, please check the reported -1(s) The full output of the test-patch run is available at . https://ci-hadoop.apache.org/job/PreCommit-OOZIE-Build/170/
          jmakai János Makai added a comment - - edited

          Hello dionusos, could you please review my patch? The issues found by SpotBugs are unrelated to this change.

          jmakai János Makai added a comment - - edited Hello dionusos , could you please review my patch? The issues found by SpotBugs are unrelated to this change.

          Commit e78ffb56310f4bee7ac053a448b2f25437f22321 in oozie's branch refs/heads/master from Denes Bodo
          [ https://gitbox.apache.org/repos/asf?p=oozie.git;h=e78ffb563 ]

          OOZIE-3688 Introduce retry mechanism when starting embedded servlet containers in unit tests (jmakai via dionusos)

          jira-bot ASF subversion and git services added a comment - Commit e78ffb56310f4bee7ac053a448b2f25437f22321 in oozie's branch refs/heads/master from Denes Bodo [ https://gitbox.apache.org/repos/asf?p=oozie.git;h=e78ffb563 ] OOZIE-3688 Introduce retry mechanism when starting embedded servlet containers in unit tests (jmakai via dionusos)
          dionusos Dénes Bodó added a comment -

          Thank jmakai for your contribution. The change is merged to master.

          dionusos Dénes Bodó added a comment - Thank jmakai for your contribution. The change is merged to master.
          jmakai János Makai added a comment -

          Many thanks for the review!

          jmakai János Makai added a comment - Many thanks for the review!

          People

            jmakai János Makai
            jmakai János Makai
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: