-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
bugfix: Resolve MySQL Driver Loading Issue (#6760) #6765
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
funky-eyes
reviewed
Aug 18, 2024
core/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.x #6765 +/- ##
============================================
+ Coverage 52.15% 52.22% +0.06%
Complexity 6294 6294
============================================
Files 1064 1064
Lines 37215 37179 -36
Branches 4417 4417
============================================
+ Hits 19411 19415 +4
+ Misses 15883 15848 -35
+ Partials 1921 1916 -5
|
funky-eyes
added
type: bug
Category issues or prs related to bug.
module/server
server module
labels
Aug 25, 2024
funky-eyes
approved these changes
Aug 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ⅰ. Describe what this PR did
This PR resolves the issue of the MySQL driver not loading when starting the
apache/seata-server:2.1.0.jre17
Docker image. The fix involves removing the custom classloader setup and relying on the default classloader to handle the MySQL driver loading. Additionally, the MySQL driver jar has been moved from thelib/jdbc
directory to thelib
directory, simplifying the path and ensuring the driver is loaded properly.Ⅱ. Does this pull request fix one issue?
fixes #6760
Ⅲ. Why don't you add test cases (unit test/integration test)?
The changes made pertain to configuration and environment setup, which are typically validated through deployment tests rather than unit or integration tests. Future contributions could focus on creating automated tests for Docker image configurations to ensure environment consistency.
Ⅳ. Describe how to verify it
To verify this fix:
lib
directory.mvn clean install -P release-seata
to build the project.incubator-seata/distribution/target/apache-seata-x.x.x-incubating-bin/apache-seata/bin
and executeseata-server.sh
.application.yml
settings forseata.config.type: file
, and check the logs to verify that thestore.db.driverClassName = com.mysql.cj.jdbc.Driver
setting fromfile.conf
is correctly utilized.Ⅴ. Special notes for reviews
Please focus on the changes made to the classloader behavior and the repositioning of the MySQL driver jar. Confirm that these changes align with best practices for Docker and Java application deployments. Additionally, verify that the removal of custom classloader settings does not inadvertently affect other aspects of the system's behavior.