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

Support using DIGEST-MD5 as the SASL mechanism for ElasticJob CoordinatorRegistryCenter under GraalVM Native Image #2428

Closed
wants to merge 1 commit into from

Conversation

linghengqian
Copy link
Member

@linghengqian linghengqian commented Aug 12, 2024

Fixes #2457.

Changes proposed in this pull request:

10:53:09.890 [main-SendThread(localhost:32791)] INFO org.apache.zookeeper.Login -- Client successfully logged in.
10:53:09.890 [main-SendThread(localhost:32791)] INFO org.apache.zookeeper.client.ZooKeeperSaslClient -- Client will use DIGEST-MD5 as SASL mechanism.
10:53:09.890 [main-SendThread(localhost:32791)] INFO org.apache.zookeeper.ClientCnxn -- Opening socket connection to server localhost/127.0.0.1:32791.
10:53:09.890 [main-SendThread(localhost:32791)] INFO org.apache.zookeeper.ClientCnxn -- SASL config status: Will attempt to SASL-authenticate using Login Context section 'Client'
10:53:09.891 [main-SendThread(localhost:32791)] INFO org.apache.zookeeper.ClientCnxn -- Socket connection established, initiating session, client: /127.0.0.1:46578, server: localhost/127.0.0.1:32791
10:53:09.907 [main-SendThread(localhost:32791)] INFO org.apache.zookeeper.ClientCnxn -- Session establishment complete on server localhost/127.0.0.1:32791, session id = 0x100005a9c630000, negotiated timeout = 40000
10:53:09.907 [main-EventThread] INFO org.apache.curator.framework.state.ConnectionStateManager -- State change: CONNECTED
10:53:09.908 [main] INFO com.zaxxer.hikari.HikariDataSource -- HikariPool-1 - Starting...
10:53:09.910 [main] INFO com.zaxxer.hikari.HikariDataSource -- HikariPool-1 - Start completed.
10:53:09.911 [main] INFO org.apache.shardingsphere.elasticjob.spring.core.setup.SpringProxyJobClassNameProvider -- create SpringProxyJobClassNameProvider
10:53:09.911 [main-SendThread(localhost:32791)] ERROR org.apache.zookeeper.client.ZooKeeperSaslClient -- SASL authentication failed using login context 'Client'.
javax.security.sasl.SaslException: Error in authenticating with a Zookeeper Quorum member: the quorum member's saslToken is null.
        at org.apache.zookeeper.client.ZooKeeperSaslClient.createSaslToken(ZooKeeperSaslClient.java:310)
        at org.apache.zookeeper.client.ZooKeeperSaslClient.respondToServer(ZooKeeperSaslClient.java:270)
        at org.apache.zookeeper.ClientCnxn$SendThread.readResponse(ClientCnxn.java:921)
        at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:98)
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1274)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:853)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:829)
10:53:09.911 [main-EventThread] ERROR org.apache.curator.ConnectionState -- Authentication failed

@linghengqian linghengqian force-pushed the sasl-zookeeper branch 3 times, most recently from e101206 to 0fbe704 Compare August 13, 2024 01:17
@linghengqian linghengqian changed the title Add nativeTest that uses DIGEST-MD5 as SASL mechanism for ElasticJob ZookeeperRegistryCenter under GraalVM Native Image Support using DIGEST-MD5 as the SASL mechanism for ElasticJob Java API under GraalVM Native Image Aug 13, 2024
@linghengqian linghengqian changed the title Support using DIGEST-MD5 as the SASL mechanism for ElasticJob Java API under GraalVM Native Image Support using DIGEST-MD5 as the SASL mechanism for ElasticJob CoordinatorRegistryCenter under GraalVM Native Image Aug 13, 2024
@linghengqian linghengqian force-pushed the sasl-zookeeper branch 5 times, most recently from a9dd4ad to dae6ed8 Compare August 13, 2024 03:03
Copy link
Member Author

@linghengqian linghengqian left a comment

Choose a reason for hiding this comment

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

sudo apt-get install build-essential zlib1g-dev -y
sdk install java 22.0.2-graalce

cd ./shardingsphere-elasticjob/
sdk use java 22.0.2-graalce
./mvnw -PnativeTestInElasticJob -T1C -e clean test
cp -rf ./test/native/src/test/java/* ./test/native/target/sources/

./test/native/target/native-tests --xml-output-dir ./test/native/target/native-test-reports -Djunit.platform.listeners.uid.tracking.output.dir=./test/native/target/test-ids
  • Interestingly, I can run native-tests locally in IntelliJ IDEA, but if I expect to debug native-tests locally in IntelliJ IDEA, IntelliJ IDEA protests. There is no straightforward description in https://www.jetbrains.com/help/idea/debug-graalvm-native.html, it's all dry text, as if assuming that what you see is what you get for the UI.
  • image
  • image
  • https://github.com/nativejdb/nativejdb looks like it's no longer updated and looks like it's about to enter an epic debugging hell. Of course nativejdb does not support jdk22 at all.

Copy link
Member Author

@linghengqian linghengqian left a comment

Choose a reason for hiding this comment

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

  • gdb local debugging is not available for IntelliJ IDEA, but gdb remote debugging is available for IntelliJ IDEA. IntelliJ IDEA is connected to the Native Image, but it seems that it is not possible to see the internals of variables. All we see is cluttered C++ pointers.
cd ./shardingsphere-elasticjob/
sdk use java 22.0.2-graalce
./mvnw -PnativeTestInElasticJob -T1C -e clean test
gdbserver :1234 ./test/native/target/native-tests --xml-output-dir ./test/native/target/native-test-reports -Djunit.platform.listeners.uid.tracking.output.dir=./test/native/target/test-ids
  • image
  • image
  • image

Copy link
Member Author

@linghengqian linghengqian left a comment

Choose a reason for hiding this comment

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

Copy link
Member Author

@linghengqian linghengqian left a comment

Choose a reason for hiding this comment

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

…natorRegistryCenter` under GraalVM Native Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant