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

Fix #1269 A bug on the metric calculation inside async API clients #1270

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

seratch
Copy link
Contributor

@seratch seratch commented Jan 23, 2024

This pull request resolves #1269, thank you so much @gunrein !

The bug had been affecting only the output of the visible metrics data for developers. The internal smart rate limiter mechanism does not use the data at all, so the impact of the misbehavior should be relatively small.

Category (place an x in each of the [ ])

  • bolt (Bolt for Java)
  • bolt-{sub modules} (Bolt for Java - optional modules)
  • slack-api-client (Slack API Clients)
  • slack-api-model (Slack API Data Models)
  • slack-api-*-kotlin-extension (Kotlin Extensions for Slack API Clients)
  • slack-app-backend (The primitive layer of Bolt for Java)

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.

@seratch seratch added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented project:slack-api-client project:slack-api-client labels Jan 23, 2024
@seratch seratch added this to the 1.37.1 milestone Jan 23, 2024
@seratch seratch self-assigned this Jan 23, 2024
@@ -80,9 +80,9 @@ public <T extends AuditApiResponse> CompletableFuture<T> execute(
}, executorService);
}

private void initCurrentQueueSizeStatsIfAbsent(String teamId, String methodNameWithSuffix) {
private void syncCurrentQueueSizeStats(String teamId, String methodNameWithSuffix) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this method is a private one, we can safely rename it to represent more accurate behavior.

@@ -264,13 +264,6 @@ public void updateCurrentQueueSize(String executorName, String teamId, String me
@Override
public void setCurrentQueueSize(String executorName, String teamId, String methodName, Integer size) {
if (this.isStatsEnabled()) {
CopyOnWriteArrayList<String> messageIds = getOrCreateMessageIds(executorName, teamId, methodName);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These lines of code are completely unnecessary. They are just an overhead when executing this method.

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (44676f5) 74.33% compared to head (bc93fa4) 74.35%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1270      +/-   ##
============================================
+ Coverage     74.33%   74.35%   +0.01%     
- Complexity     4124     4125       +1     
============================================
  Files           443      443              
  Lines         13092    13080      -12     
  Branches       1324     1323       -1     
============================================
- Hits           9732     9725       -7     
+ Misses         2588     2582       -6     
- Partials        772      773       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@seratch seratch merged commit fdab0f2 into slackapi:main Jan 23, 2024
4 checks passed
@seratch seratch deleted the issue-1269-async-client-metrics branch January 23, 2024 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented project:slack-api-client project:slack-api-client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A bug on the metric calculation inside async API clients
1 participant