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

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

Open
seratch opened this issue May 19, 2022 · 2 comments
Assignees
Labels
enhancement M-T: A feature request for new functionality project:slack-api-client project:slack-api-client
Milestone

Comments

@seratch
Copy link
Member

seratch commented May 19, 2022

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.

@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 May 19, 2022
@seratch seratch added this to the 1.x milestone May 19, 2022
@seratch seratch self-assigned this May 19, 2022
@seratch seratch added enhancement M-T: A feature request for new functionality and removed bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented labels Jun 14, 2022
@jfbenckhuijsen
Copy link

Also running into this issue. I'm working on a slack app using Quarkus, where I hope the native compilation will allow the app to start up fast enough for the 3-second limit on processing the Events API.

Running native compilation requires exclusion of these default classes because of the threads started (which Quarkus doesn't allow)

@seratch
Copy link
Member Author

seratch commented Jul 14, 2022

@jfbenckhuijsen Thanks for sharing this. However, even when this issue is resolved, this SDK still does not support native builds. Refer to #1009 for more details. We are not planning to add native supports as long as gson project is ready for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality project:slack-api-client project:slack-api-client
Projects
None yet
Development

No branches or pull requests

2 participants