slackapi / slackapi/java-slack-sdk

5 threads (for the default singleton) can be created even when SlackConfig#statsEnabled is false

Open
#987 2 comments 1 reaction 1 assignee View on GitHub

@seratch is already working on this.

Since May 19, 2022.

enhancement project:slack-api-client
Dominant language
Java
Stars
602
Forks
232
Avg merge
4d 9h
Merged PRs (30d)
7

Description

Developers can disable API clients' metrics management by setting SlackConfig#statsEnabled to false. Even in this case, the default SlackConfig object creation (as a static field in the class) starts 5 threads and those threads are unused. See the repro steps below for details.

Reproducible in:

any versions

The Slack SDK version

any versions

Java Runtime version

any versions

OS info

any versions

Steps to reproduce:

Running the following code and checking the thread dump.

SlackConfig config = new SlackConfig();
config.setStatsEnabled(false);
Slack slack = Slack.getInstance(config);
Expected result:

No threads under a "slack-api-metrics" thread group are created.

Actual result:

5 threads for the default singleton SlackConfig instance are created.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.