-
Notifications
You must be signed in to change notification settings - Fork 852
Closed
Labels
Version: 2xarea:concurrencyIssues and PRs related to concurrencyIssues and PRs related to concurrencybugM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedweb-client
Description
Description
API calls seem to spawn threads without ever releasing them. I'm not sure if this is an issue with aiohttp or with how slackclient uses it. Or perhaps I am misusing/misunderstanding the client?
What type of issue is this?
- bug
- enhancement (feature request)
- question
- documentation related
- testing related
- discussion
Requirements
- I've read and understood the Contributing guidelines and have done my best effort to follow them.
- I've read and agree to the Code of Conduct.
- I've searched for any related issues and avoided creating a duplicate issue.
Bug Report
Reproducible in:
slackclient version: 2.1.0
python version: 3.6.7
OS version(s): Ubuntu 18.04.1 LTS (LXC on Proxmox)
Steps to reproduce:
- Post a few messages using slackclient's
chat_postMessageor anything that involves an api call. - Run
htoportop -H - Observe many sleeping
pythonthreads (they are released once the program ends, though, so you'll have to watch while the program is running)
Expected result:
Each API call should make its request and then release/end the thread.
Actual result:
Upon API call completion, sleeping threads are leftover. I think this could be a slow memory leak if many calls are made over time.
Attachments:

Code to generate the screenshot above:
import os
import slack
import time
from dotenv import load_dotenv
load_dotenv()
client = slack.WebClient(token=os.getenv("SLACK_TOKEN"))
for x in range(10):
print("Posting message")
client.chat_postMessage(
channel=os.getenv("TEST_CHANNEL_ID"),
text="Hello from your app! :tada:"
)
time.sleep(1)
time.sleep(10)I also tested running async and got the same result. Please let me know if you need any additional information from me. Thank you for your work on this great client!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Version: 2xarea:concurrencyIssues and PRs related to concurrencyIssues and PRs related to concurrencybugM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedM-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documentedweb-client