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

bugfix: fix data source initialize more times #2670

Merged
merged 11 commits into from
May 12, 2020

Conversation

l81893521
Copy link
Contributor

Ⅰ. Describe what this PR did

fix data source initialize more than one time cause the data source instance is not a single instance.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@l81893521 l81893521 changed the title bugfix: fix data source initialize more time bugfix: fix data source initialize more times May 9, 2020
@codecov-io
Copy link

codecov-io commented May 9, 2020

Codecov Report

Merging #2670 into develop will increase coverage by 0.25%.
The diff coverage is 41.66%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2670      +/-   ##
=============================================
+ Coverage      50.65%   50.91%   +0.25%     
- Complexity      2812     2814       +2     
=============================================
  Files            558      558              
  Lines          17914    17936      +22     
  Branches        2088     2126      +38     
=============================================
+ Hits            9075     9132      +57     
+ Misses          7947     7934      -13     
+ Partials         892      870      -22     
Impacted Files Coverage Δ Complexity Δ
...eata/core/store/db/AbstractDataSourceProvider.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...ta/server/storage/db/lock/DataBaseLockManager.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...rage/db/store/DataBaseTransactionStoreManager.java 71.31% <100.00%> (-0.23%) 23.00 <0.00> (ø)
.../io/seata/server/store/DbcpDataSourceProvider.java 100.00% <100.00%> (ø) 2.00 <1.00> (?)
...io/seata/server/store/DruidDataSourceProvider.java 100.00% <100.00%> (ø) 2.00 <1.00> (?)
...o/seata/server/store/HikariDataSourceProvider.java 100.00% <100.00%> (ø) 2.00 <1.00> (?)
...in/java/io/seata/server/session/GlobalSession.java 83.71% <0.00%> (-0.55%) 71.00% <0.00%> (ø%)
...java/io/seata/spring/tcc/TccActionInterceptor.java 12.82% <0.00%> (-0.34%) 2.00% <0.00%> (ø%)
...n/java/io/seata/rm/datasource/ConnectionProxy.java 28.00% <0.00%> (-0.23%) 13.00% <0.00%> (ø%)
...a/io/seata/core/rpc/netty/AbstractRpcRemoting.java 10.55% <0.00%> (-0.22%) 4.00% <0.00%> (ø%)
... and 26 more

@slievrly
Copy link
Member

slievrly commented May 9, 2020

@l81893521 Whether to need to adjust the connection pool of the default number of connections?

@zjinlei zjinlei added this to the 1.3.0 milestone May 10, 2020
@l81893521
Copy link
Contributor Author

@l81893521 Whether to need to adjust the connection pool of the default number of connections?

ok, DEFAULT_DB_MAX_CONN already change to 20


@Override
public DataSource provide() {
return getDataSource();
Copy link
Contributor

Choose a reason for hiding this comment

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

common method, move to abstract class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

LGTM

private final String datasourceType = "dbcp";

@Test
public void testDbcpDataSourceProvider() {
Copy link
Member

Choose a reason for hiding this comment

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

You can put the test case in the abstract class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

@ph3636
Copy link
Contributor

ph3636 commented May 12, 2020

Pay attention to the package order

Copy link
Member

@jsbxyyx jsbxyyx left a comment

Choose a reason for hiding this comment

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

LGTM

*/
public class AbstractDataSourceProviderTest {

private final String dbcpDatasourceType = "dbcp";
Copy link
Member

@jsbxyyx jsbxyyx May 12, 2020

Choose a reason for hiding this comment

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

merge dataSourceType to array. for each test dataSource not null? simplify test case?

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@zjinlei zjinlei left a comment

Choose a reason for hiding this comment

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

LGTM

@zjinlei zjinlei merged commit fd3edf6 into apache:develop May 12, 2020
@l81893521 l81893521 deleted the fix_single_datasource_instance branch June 5, 2020 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants