{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-ruby/issues/1067","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-ruby","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-ruby/issues/1067/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-ruby/issues/1067/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-ruby/issues/1067/events","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues/1067","id":190739846,"number":1067,"title":"Memory leaked as all network endpoints were not shut down","user":{"login":"HaipengSu","id":13719899,"avatar_url":"https://avatars.githubusercontent.com/u/13719899?v=3","gravatar_id":"","url":"https://api.github.com/users/HaipengSu","html_url":"https://github.com/HaipengSu","followers_url":"https://api.github.com/users/HaipengSu/followers","following_url":"https://api.github.com/users/HaipengSu/following{/other_user}","gists_url":"https://api.github.com/users/HaipengSu/gists{/gist_id}","starred_url":"https://api.github.com/users/HaipengSu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaipengSu/subscriptions","organizations_url":"https://api.github.com/users/HaipengSu/orgs","repos_url":"https://api.github.com/users/HaipengSu/repos","events_url":"https://api.github.com/users/HaipengSu/events{/privacy}","received_events_url":"https://api.github.com/users/HaipengSu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-21T14:57:17Z","updated_at":"2016-11-21T15:05:47Z","closed_at":"2016-11-21T15:05:47Z","body":"I got an interesting scenario when using google-cloud-pubsub. \r\n\r\nI would like to get all the topics in the pubsub, and my code is, \r\n\r\nfrom google.cloud import pubsub\r\ndef list_topics(pubsub_client):\r\n    \"\"\"Lists all Pub/Sub topics in the current project.\"\"\"\r\n  topics= pubsub_client.list_topics()\r\n  for topic in topics:\r\n      print topic.name\r\n\r\npubsub_client=pubsub.Client()\r\nlist_topics(pubsub_client)\r\n\r\nI keep getting message `E1121 09:40:01.036257519   10741 network_status_tracker.c:48] Memory leaked as all network endpoints were not shut down`.\r\n\r\nHowever, if I use `pubsub_client=pubsub.Client()` inside the function, \r\n\r\nfrom google.cloud import pubsub\r\ndef list_topics():\r\n    \"\"\"Lists all Pub/Sub topics in the current project.\"\"\"\r\n    pubsub_client=pubsub.Client()\r\n    topics= pubsub_client.list_topics()\r\n    for topic in topics:\r\n        print topic.name\r\n\r\nlist_topics()\r\n\r\nThen, the message disappeared. \r\n\r\nI noticed that there is similar questions before, but could't figure it out. \r\n\r\nThank you\r\n     "},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-ruby/issues/comments/261962546","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues/1067#issuecomment-261962546","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-ruby/issues/1067","id":261962546,"user":{"login":"HaipengSu","id":13719899,"avatar_url":"https://avatars.githubusercontent.com/u/13719899?v=3","gravatar_id":"","url":"https://api.github.com/users/HaipengSu","html_url":"https://github.com/HaipengSu","followers_url":"https://api.github.com/users/HaipengSu/followers","following_url":"https://api.github.com/users/HaipengSu/following{/other_user}","gists_url":"https://api.github.com/users/HaipengSu/gists{/gist_id}","starred_url":"https://api.github.com/users/HaipengSu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaipengSu/subscriptions","organizations_url":"https://api.github.com/users/HaipengSu/orgs","repos_url":"https://api.github.com/users/HaipengSu/repos","events_url":"https://api.github.com/users/HaipengSu/events{/privacy}","received_events_url":"https://api.github.com/users/HaipengSu/received_events","type":"User","site_admin":false},"created_at":"2016-11-21T15:05:47Z","updated_at":"2016-11-21T15:05:47Z","body":"Sorry, I posted in the wrong module, should be in google-cloud-python"}}
{"actor":{"display_login":"HaipengSu"}}