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

[#589] Upgrading netty to enable JDK17 #668

Closed
wants to merge 1 commit into from

Conversation

arrdem
Copy link

@arrdem arrdem commented Jan 4, 2022

Overview

Fixes #589, may fix #484 by upgrading Netty (and json-smart)

External contributors - please answer these questions before submitting a pull request. Thanks!

Please answer these questions before submitting your pull requests. Thanks!

  1. What GitHub issue is this PR adressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-755767: snowflake-jdbc driver fails with JDK >= 16 #589 which relates directly to SNOW-340077: UnsupportedOperationException sun.misc.Unsafe or java.nio.DirectByteBuffer when running on JDK16 #484, both of which are the result of Project Jigsaw encapsulation.

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am modyfying authorization mechanisms
    • I am adding new credentials
    • I am modyfying OCSP code
    • I am adding a new dependency
  3. Please describe how your code solves the related issue.

Netty (netty-common) is ultimately at fault for the JDK17 illegal access reported in both tickets. Arrow depends on that machinery by simple dependency. snowflake-jdbc pulls in and shades both arrow and netty components. This makes it impossible for users of snowflake-jdbc to directly override the packaged dependency and run a newer (fixed) netty.

Per the netty maintainers 4.1.52+ has fixes for JDK17 access restrictions. In my testing rolling a snowflake-jdbc jar which forces netty-* to 4.1.72.Final (latest) resolves these issues.

Pre-review checklist

  • This change has passed precommit
  • I have reviewed code coverage report for my PR in (Sonarqube)

@arrdem arrdem marked this pull request as draft January 4, 2022 22:54
@arrdem
Copy link
Author

arrdem commented Jan 5, 2022

For future reference, this patch is sorta in the right direction. Netty is "at fault" here, but only inasmuch as it's gracefully degrading over a removed API which Arrow is trying to use. This means that a real JDK17 fix needs to live in Arrow and there's no "quick" fix to be had. Ultimately for snowflake this will "just" be version bumps, but this isn't it.

Closing this out since it doesn't solve the problem.

@arrdem arrdem closed this Jan 5, 2022
@seankumar-tl
Copy link

seankumar-tl commented Jan 7, 2022

@arrdem - looks like Arrow may have resolved the issue on their end with the latest release which upgrades its Netty dependency:

https://github.com/apache/arrow/pull/11293/files
https://issues.apache.org/jira/browse/ARROW-14198

The dependency would need to be upgraded from 0.15.1 to 6.0.0 https://arrow.apache.org/release/6.0.0.html

@seankumar-tl seankumar-tl mentioned this pull request Jan 20, 2022
8 tasks
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