-
Notifications
You must be signed in to change notification settings - Fork 520
Closed
Labels
P1Breaking issue affecting some users or workflowsBreaking issue affecting some users or workflowsbugSomething isn't workingSomething isn't working
Description
Each time you search on a client, new threads are created that are not destroyed. e.g. if you need to use many clients and run
def test():
auth_string = """****"""
client = google_ads.client.GoogleAdsClient.load_from_string(auth_string)
service = client.get_service("GoogleAdsService")
res = service.search(
"****", "select campaign.resource_name from campaign limit 1"
)
res = list(res)
for i in range(10000):
test()Then run watch -n1 "ps -eLf | wc -l" in another terminal, you can see the number of threads creeping up. After a while you'll reach your machines thread limit then have lots of system wide problems.
If you comment out the last line turning the results generator into a list, the problem disappears, so I think the thread creation is occurring there?
As far as I can tell there isn't a .close() function on the client or service I'm missing?
j-walker23
Metadata
Metadata
Assignees
Labels
P1Breaking issue affecting some users or workflowsBreaking issue affecting some users or workflowsbugSomething isn't workingSomething isn't working