Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIFI-10219 Remove jna-platform from nifi-bootstrap-utils #6199

Closed
wants to merge 1 commit into from

Conversation

exceptionfactory
Copy link
Contributor

Summary

NIFI-10219 Removes the jna-platform dependency from nifi-bootstrap-utils and removes the private OSUtils.getWindowsProcessId() method which depends on reflection and JNA access for Java 8 on Windows.

Removing the jna-platform dependency removes support for retrieving spawned Process Identifiers on Windows when running on Java 8, but all references to OSUtils.getProcessId() treat the PID as optional. Furthermore, the bootstrap components leverage ps and kill commands that are not available on Windows, so having the PID available on Windows does not support additional operations. Java 9 and following provide a standard method for retrieving the PID.

Eliminating the direct dependency on jna-platform removes the library from lib/bootstrap and allows the library to be placed in lib/properties as a transitive dependency of nifi-property-protection-azure, avoiding runtime class definition issues. This also avoids the need to adjust the nifi-assembly configuration to remove the jna-platform dependency to a different location, or provide multiple copies.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using mvn clean install -P contrib-check
    • JDK 8
    • JDK 11
    • JDK 17

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

- Removed OSUtils.getWindowsProcessId() which removes JNA-based retrieval of Process ID retrieval for Windows on Java 8
- Removing jna-platform from nifi-bootstrap-utils eliminates the library from lib/bootstrap and allows it as a dependency in lib/properties
@jfrazee
Copy link
Member

jfrazee commented Jul 12, 2022

Thanks @exceptionfactory. I verified the fix and checked that there were minimal changes in ./lib. I'm running the contrib-check and will merge shortly assuming no issue.

@jfrazee jfrazee closed this in 2a9139c Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants