Skip to content

Helix Issue 1319: Fix Maven builds failing on on Java 11 and above#1424

Merged
narendly merged 1 commit intoapache:masterfrom
brentwritescode:master
Oct 2, 2020
Merged

Helix Issue 1319: Fix Maven builds failing on on Java 11 and above#1424
narendly merged 1 commit intoapache:masterfrom
brentwritescode:master

Conversation

@brentwritescode
Copy link
Contributor

Issues

  • My PR addresses the following Helix issues and references them in the PR description:

(Fixes #1319 )

Description

  • Here are some details about my PR, including screenshots of any UI changes:

A small addition of Maven dependencies to make Apache Helix build successfully on Java 11 and above out-of-the-box. The core issue is that, as of Java 11, some legacy J2EE-related packages such as javax.annotation.* and javax.xml.bind.* have been removed from the JDK, but the helix/zookeeper-api and helix-core sub-builds of the project still require these libraries. For Java 11 and beyond, these packages need to be fetched from Maven Central.

See the following for more details: http://openjdk.java.net/jeps/320

Tests

  • The following tests are written for this issue:

n/a

  • The following is the result of the "mvn test" command on the appropriate module:

I ran "mvn test" on OpenJDK v1.8.0_265 and OpenJDK v11.0.8 on Ubuntu 18.04. Per the discussion on #1319, I ran tests individually (i.e. "mvn clean install package") for the following modules: /helix-core, /zookeeper-api, /helix-rest, /helix-common

This is a summary of the results:

/helix-core
- Java 8: OK
[ERROR]   TestDelayedWagedRebalanceWithDisabledInstance.testPartitionMovementAfterDelayTime:82->TestDelayedAutoRebalanceWithDisabledInstance.testPartitionMovementAfterDelayTime:204->ZkTestBase.validateMinActiveAndTopStateReplica:518 Test-DB-createTestDBs0_0 has less active replica 2 then required 3 expected:<true> but was:<false>
OK - Ran successfully standalone
[ERROR]   TestJobFailureDependence.testWorkflowFailureJobThreshold ? ThreadTimeout Metho...
OK - Ran successfully in IntelliJ
[ERROR]   TestScheduleDelayTask.testDeplayTimeAndStartTime ? ThreadTimeout Method org.te...
[ERROR]   TestScheduleDelayTask.testJobQueueDelay ? ThreadTimeout Method org.testng.inte...
OK - Ran successfully standalone
[ERROR]   TestWorkflowTermination.testWorkflowPausedTimeout:168 ? Helix Workflow "testWo...
OK - Ran successfully standalone
- Java 11: OK
[ERROR]   TestDelayedWagedRebalanceWithDisabledInstance.testPartitionMovementAfterDelayTime:82->TestDelayedAutoRebalanceWithDisabledInstance.testPartitionMovementAfterDelayTime:204->ZkTestBase.validateMinActiveAndTopStateReplica:518 Test-DB-createTestDBs0_0 has less active replica 2 then required 3 expected:<true> but was:<false>
OK - Ran successfully standalone
[ERROR]   TestScheduleDelayTask.testDeplayTimeAndStartTime ? ThreadTimeout Method org.te...
[ERROR]   TestScheduleDelayTask.testScheduleDelayTaskWithDelayTime ? ThreadTimeout Metho...
[ERROR]   TestScheduleDelayTask.testScheduleDelayTaskWithStartTime ? ThreadTimeout Metho...
OK - Ran successfully standalone
[ERROR]   TestTaskNumAttempts.testTaskNumAttemptsWithDelay:76 expected:<3> but was:<2>
OK - Ran successfully standalone

/zookeeper-api
- Java 8: OK
- Java 11: OK

/helix-rest
- Java 8: OK
- Java 11: OK

/helix-common
- Java 8: OK
- Java 11: OK

In both Java versions there were failures in /helix-core, but when I ran the failing tests by themselves, they passed (again, per discussion in the linked issue).

Documentation (Optional)

  • In case of new functionality, my PR adds documentation in the following wiki page:

New pages:

Updated pages:

Commits

  • My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Helix Issue 1319: Fix Maven builds failing on on Java 11 and above

The helix-zookeeper and helix-core subprojects fail to build on later
versions of Java due to changes in the structure of the JDK starting
in Java 11. These dependencies on older J2EE packages are no longer
in the JDK and must now be pulled from Maven directly.

Code Quality

  • My diff has been formatted using helix-style.xml
    (helix-style-intellij.xml if IntelliJ IDE is used)

I verified that pom.xml formatting matches existings pom.xml formatting (including tabs vs. spaces).

The helix-zookeeper and helix-core subprojects fail to build on later
versions of Java due to changes in the structure of the JDK starting
in Java 11. These dependencies on older J2EE packages are no longer
in the JDK and must now be pulled from Maven directly.
@brentwritescode
Copy link
Contributor Author

Is it possible that this might be a transient test failure? If I run the zookeeper-api build locally with mvn clean test, I get this:

[INFO] Tests run: 46, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 83.349 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 46, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:22 min
[INFO] Finished at: 2020-10-01T17:32:23Z
[INFO] ------------------------------------------------------------------------

Copy link
Contributor

@narendly narendly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @brentwritescode .

I've also went over the testing page, and it reads good to me. One tip: you don't need to embed the issue number in your commit title- that's why we require contributors to include the issue number in the PR description. PR number automatically gets embedded (#1424). Looking forward to your continued contribution!

@narendly narendly merged commit 9699e95 into apache:master Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation states build requirements as JDK 1.8+, Maven 3.5.0+, but Helix fails to build for Java 11+

2 participants