Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-1359

Remove the JNA dependency by using JDK Unix domain socket support

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • None
    • N/A
    • Other
    • None

    Description

      Since CONJ-1354 replaced waffle-jna with the JDK native GSS-API bridge, JNA (jna and jna-platform, both optional) is only used by the socket layer:

      • UnixDomainSocket binds libc socket/connect/recv/send/close through Native.register("c") to implement the localSocket option.
      • NamedPipeSocket calls Kernel32.WaitNamedPipe when a pipe is busy, with an existing sleep-and-retry fallback used when JNA is absent.
      • SocketUtility calls Platform.getOSType() only to detect JNA presence.

      Java 16 provides native Unix domain socket support through SocketChannel.open(StandardProtocolFamily.UNIX) and UnixDomainSocketAddress, which removes the need for a native access library.

      goal is to:

      • Add a java16 multi-release source tree with a UnixDomainSocket built on a UNIX SocketChannel, and the matching compile-java-16 execution in the pom profiles.
      • Make the Java 8 baseline UnixDomainSocket fail with a clear "requires Java 16+" error.
      • Drop the WaitNamedPipe branch from NamedPipeSocket and the JNA presence check from SocketUtility.
      • Remove JNA from the pom profiles, module-info.java (requires static com.sun.jna*), bnd.bnd Import-Package, and the SBOM vendor list.

      (OpenJDK java 8 EOL is end of November 2026)

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              diego dupin Diego Dupin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.