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

[ISSUE #6881] Fix scheduled messages are replayed bug #6882

Merged
merged 2 commits into from
Jun 11, 2023
Merged

[ISSUE #6881] Fix scheduled messages are replayed bug #6882

merged 2 commits into from
Jun 11, 2023

Conversation

gaoyf
Copy link
Contributor

@gaoyf gaoyf commented Jun 9, 2023

Which Issue(s) This PR Fixes

#6881

Fixes #issue_id

Brief Description

scheduled messages are replayed bug

How Did You Test This Change?

@@ -82,7 +82,7 @@ public class ScheduleMessageService extends ConfigManager {
private DataVersion dataVersion = new DataVersion();
private boolean enableAsyncDeliver = false;
private ScheduledExecutorService handleExecutorService;
private final ScheduledExecutorService scheduledPersistService;
private ScheduledExecutorService scheduledPersistService;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better that keep the scheduledPersistService final and initialize it in the contructor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I have changed the code.

@@ -161,15 +152,15 @@ public void start() {
}
}

this.deliverExecutorService.scheduleAtFixedRate(() -> {
scheduledPersistService = new ScheduledThreadPoolExecutor(1,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to change the code here? In my opinion, removing the scheduleAtFixedRate in the constructor is enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have change the code. I think persist task should execute by scheduledPersistService but not deliverExecutorService.

@RongtongJin RongtongJin changed the title fix scheduled messages are replayed bug [ISSUE #6881] Fix scheduled messages are replayed bug Jun 9, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #6882 (d9d2f65) into develop (4d82b30) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@              Coverage Diff              @@
##             develop    #6882      +/-   ##
=============================================
- Coverage      42.45%   42.45%   -0.01%     
  Complexity      9104     9104              
=============================================
  Files           1125     1125              
  Lines          80255    80248       -7     
  Branches       10453    10453              
=============================================
- Hits           34072    34067       -5     
- Misses         41884    41895      +11     
+ Partials        4299     4286      -13     
Impacted Files Coverage Δ
...cketmq/broker/schedule/ScheduleMessageService.java 58.57% <100.00%> (+0.02%) ⬆️

... and 26 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@RongtongJin RongtongJin merged commit 0f1ff25 into apache:develop Jun 11, 2023
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.

5 participants