Skip to content

[Bug-3140]fix the deadlock between start and stop of ZKServer#3141

Merged
qiaozhanwei merged 10 commits intoapache:devfrom
tswstarplanet:ZkServer_deadlock
Jul 13, 2020
Merged

[Bug-3140]fix the deadlock between start and stop of ZKServer#3141
qiaozhanwei merged 10 commits intoapache:devfrom
tswstarplanet:ZkServer_deadlock

Conversation

@tswstarplanet
Copy link
Copy Markdown
Contributor

@tswstarplanet tswstarplanet commented Jul 5, 2020

fix #3140

Tips

What is the purpose of the pull request

(For example: This pull request adds checkstyle plugin.)

Brief change log

(for example:)

  • Remove the synchronized of start and stop method.
  • Let the ZkServer can start with custom port when execute the "public static void main" method.
  • Refactor the static method to object method to avoid the JMException when execute unit test.

Verify this pull request

(Please pick either of the following options)

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added dolphinscheduler-dao tests for end-to-end.
  • Added CronUtilsTest to verify the change.
  • Manually verified the change by testing locally.

tswstarplanet and others added 2 commits July 12, 2020 00:01
…uler/service/zk/ZKServer.java

Co-authored-by: Yichao Yang <1048262223@qq.com>
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 2 Code Smells

61.4% 61.4% Coverage
0.0% 0.0% Duplication

logger.info("Zookeeper data path : {} ", dataDirPath);
dataDir = dataDirPath;
final String[] args = new String[]{Integer.toString(port), dataDirPath, Integer.toString(tickTime), maxClientCnxns};
private void startLocalZkServer(final int port, final String dataDirPath,final int tickTime,String maxClientCnxns) {
Copy link
Copy Markdown
Contributor

@yangyichao-mango yangyichao-mango Jul 12, 2020

Choose a reason for hiding this comment

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

Suggested change
private void startLocalZkServer(final int port, final String dataDirPath,final int tickTime,String maxClientCnxns) {
private void startLocalZkServer(final int port, final String dataDirPath, final int tickTime, String maxClientCnxns) {

Hi,
Thx a lot for your good job and contribution.
Please configure the checkstyle.xml plugin[1] to your IDE to help format code.
[1] https://github.com/apache/incubator-dolphinscheduler/tree/dev/style

Copy link
Copy Markdown
Contributor

@qiaozhanwei qiaozhanwei left a comment

Choose a reason for hiding this comment

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

+1

@qiaozhanwei qiaozhanwei merged commit 753ed58 into apache:dev Jul 13, 2020
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.

[BUG] Embed zookeeper server 'ZKServer' has deadlock problem

4 participants