)]}'
{"id":"openstack%2Fpython-glanceclient~674133","triplet_id":"openstack%2Fpython-glanceclient~master~Idccff338fa84c46ca0e429bb533a2a5217205eef","project":"openstack/python-glanceclient","branch":"master","topic":"bug/1838694","hashtags":[],"change_id":"Idccff338fa84c46ca0e429bb533a2a5217205eef","subject":"Cleanup session object","status":"MERGED","created":"2019-08-01 20:41:29.000000000","updated":"2019-12-11 08:18:40.000000000","submitted":"2019-12-11 08:16:27.000000000","submitter":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"total_comment_count":2,"unresolved_comment_count":0,"has_review_started":true,"submission_id":"674133-1576052187679-51380ceb","meta_rev_id":"420510f9fbadd51cbc86b4d7a7ac0311e9861d8f","_number":674133,"virtual_id_number":674133,"owner":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"actions":{},"labels":{"Verified":{"approved":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"all":[{"tag":"autogenerated:zuul:gate","value":2,"date":"2019-12-11 08:16:27.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"value":0,"date":"2019-12-09 20:30:57.000000000","_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},{"value":0,"date":"2019-12-05 21:27:46.000000000","_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},{"value":0,"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},{"value":0,"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"}],"values":{"-2":"Fails","-1":"Doesn\u0027t seem to work"," 0":"No score","+1":"Works for me","+2":"Verified"},"description":"","default_value":0,"optional":true},"Code-Review":{"approved":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"all":[{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"value":0,"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},{"value":0,"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},{"value":2,"date":"2019-12-11 06:35:39.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},{"value":2,"date":"2019-12-10 11:40:23.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"}],"values":{"-2":"Do not merge","-1":"This patch needs further work before it can be merged"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me (core reviewer)"},"description":"","default_value":0,"optional":true},"Workflow":{"approved":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"all":[{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"value":0,"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},{"value":0,"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},{"value":1,"date":"2019-12-11 06:35:39.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},{"value":0,"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"}],"values":{"-1":"Work in progress"," 0":"Ready for reviews","+1":"Approved"},"description":"","default_value":0,"optional":true},"Review-Priority":{"all":[{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},{"value":0,"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},{"value":0,"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},{"value":0,"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},{"value":0,"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"}],"values":{"-1":"Branch Freeze"," 0":"No Priority","+1":"Important Change","+2":"Top Priority / Holds Gate"},"description":"","default_value":0,"optional":true}},"removable_reviewers":[],"reviewers":{"REVIEWER":[{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2019-12-05 21:27:46.000000000","updated_by":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"reviewer":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"state":"REVIEWER"},{"updated":"2019-12-10 11:40:23.000000000","updated_by":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"reviewer":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"state":"REVIEWER"},{"updated":"2019-12-11 06:35:39.000000000","updated_by":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"reviewer":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"state":"REVIEWER"},{"updated":"2019-12-11 08:16:27.000000000","updated_by":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"reviewer":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"state":"REVIEWER"}],"messages":[{"id":"16e6e7a2fe879dd86a68c299a48ed3a7f823fd95","author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"date":"2019-08-01 20:41:29.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"1c20b4b8ac5ccba1ed77f14615a316d272e4a58f","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-08-01 22:25:29.000000000","message":"Patch Set 1: Verified+1\n\nBuild succeeded (check pipeline).\n\n- tempest-full https://logs.opendev.org/33/674133/1/check/tempest-full/2e6ea87/ : SUCCESS in 1h 22m 30s\n- tempest-full-py3 https://logs.opendev.org/33/674133/1/check/tempest-full-py3/26198ef/ : SUCCESS in 1h 37m 44s\n- openstack-tox-cover https://logs.opendev.org/33/674133/1/check/openstack-tox-cover/a2c762e/cover/ : SUCCESS in 5m 07s\n- openstack-tox-lower-constraints https://logs.opendev.org/33/674133/1/check/openstack-tox-lower-constraints/7022c4b/ : SUCCESS in 3m 54s\n- openstack-tox-pep8 https://logs.opendev.org/33/674133/1/check/openstack-tox-pep8/7672aeb/ : SUCCESS in 3m 16s\n- openstack-tox-py27 https://logs.opendev.org/33/674133/1/check/openstack-tox-py27/d215463/ : SUCCESS in 3m 42s\n- openstack-tox-py36 https://logs.opendev.org/33/674133/1/check/openstack-tox-py36/507db4a/ : SUCCESS in 3m 54s\n- openstack-tox-py37 https://logs.opendev.org/33/674133/1/check/openstack-tox-py37/9062d32/ : SUCCESS in 3m 40s\n- openstack-tox-docs https://logs.opendev.org/33/674133/1/check/openstack-tox-docs/953524c/html/ : SUCCESS in 3m 28s\n- glanceclient-dsvm-functional-v1 https://logs.opendev.org/33/674133/1/check/glanceclient-dsvm-functional-v1/067dc13/ : SUCCESS in 35m 55s\n- glanceclient-dsvm-functional https://logs.opendev.org/33/674133/1/check/glanceclient-dsvm-functional/3372f03/ : SUCCESS in 37m 15s","accounts_in_message":[],"_revision_number":1},{"id":"0083b3356a65cf9921d0dbc40cac88ccb9d9ac05","author":{"_account_id":597,"name":"Pete Zaitcev","email":"zaitcev@kotori.zaitcev.us","username":"zaitcev"},"date":"2019-12-05 21:27:46.000000000","message":"Patch Set 1:\n\nAbishkek, are you okay with this? We\u0027re having a little bit of a controversy in Swift over the sister review. What\u0027s the Glance core\u0027s perspective?\n\nhttps://review.opendev.org/674320","accounts_in_message":[],"_revision_number":1},{"id":"d542e994e25ac0ced2e87ec55412c632b7c4ed0d","author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"date":"2019-12-06 06:07:07.000000000","message":"Patch Set 1:\n\nIMO it is not guaranteed that this __del__ method will be called all the time, but this could be the easiest way to close the session. Lets see what other cores suggests on this.","accounts_in_message":[],"_revision_number":1},{"id":"c0db796e7498b03e9e4d5d44b0ba2460e6c57486","author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"date":"2019-12-09 20:08:49.000000000","message":"Patch Set 1:\n\n(1 comment)\n\nThanks for looking into this Alex,\n\nCouple of quiestions, one technical nit inline, the other as following.\n\nIf we kill the session every time we get rid of the client, why should we allow passing the session in at the first place? I do agree that leaving orphaned sessions around is not great practise (and not sure why that happens in the first place and is not taken care of by garbage collection, is this perhaps problem in requests not cleaning system resources correctly?).\n\nIf I understand this patch correctly anyone who passes their session to the client after this patch will send it to suicide mission as that session will be closed after the client gets cleaned meaning that the session cannot be used again.\n\nWouldn\u0027t it make sense to rather keep track if this is session that was created during the client initialization or even better look into not using session if one is not passed to the client?\n\nMy bigger concern is that the __del__ method will be called most of the time rather than Abhisheks concern that it might not be called every time.","accounts_in_message":[],"_revision_number":1},{"id":"83ac0486a2c81c09666c5590f6166bdd35144283","author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"date":"2019-12-09 20:30:57.000000000","message":"Patch Set 1:\n\n(1 comment)\n\nSo unlike the other clients, glanceclient doesn\u0027t accept a session.\nhttps://opendev.org/openstack/python-glanceclient/src/branch/master/glanceclient/common/http.py#L157-L184  If it did then we could reuse sessions and control this externally. The problem is that it doesn\u0027t so we get a warning printed every time we consume glanceclient. swiftclient and keystoneauth1 also suffered from this problem but patches have merged to address those.\n\nIt always creates a session. \n\n\nOther clients: \n\nhttps://opendev.org/openstack/python-novaclient/src/branch/master/novaclient/client.py#L89-L154\nhttps://opendev.org/openstack/python-cinderclient/src/branch/master/cinderclient/client.py#L689-L740\nhttps://opendev.org/openstack/python-neutronclient/src/branch/master/neutronclient/client.py#L382-L435\nhttps://opendev.org/openstack/python-barbicanclient/src/branch/master/barbicanclient/client.py#L122-L181\n\n\nThe issue here is just to attempt to close the session semi-cleanly rather than leaving it open at the end and forcefully killing things off. Right now the session isn\u0027t closed properly and there doesn\u0027t really appear to be any other way here to try and do it at the end of the glance client lifecycle. Yes __del__ may not be called because of other references, but I would bet that\u0027s not the regular consumption of these clients.","accounts_in_message":[],"_revision_number":1},{"id":"7c1abd76b05830ac3cb95a5547e7d8ef67c1ee4e","author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"date":"2019-12-10 11:40:23.000000000","message":"Patch Set 1: Code-Review+2\n\n\u003e (1 comment)\n \u003e \n \u003e So unlike the other clients, glanceclient doesn\u0027t accept a session.\n \u003e https://opendev.org/openstack/python-glanceclient/src/branch/master/glanceclient/common/http.py#L157-L184\n \u003e  If it did then we could reuse sessions and control this\n \u003e externally. The problem is that it doesn\u0027t so we get a warning\n \u003e printed every time we consume glanceclient. swiftclient and\n \u003e keystoneauth1 also suffered from this problem but patches have\n \u003e merged to address those.\n\nIt does, you just get SessionClient instance instead, so I assume you\u0027re initializing HTTPClient direcftly https://opendev.org/openstack/python-glanceclient/src/branch/master/glanceclient/common/http.py#L381-L388\n\nHonestly didn\u0027t remember myself that it was implemented this way in python-glanceclient.\n\nWhich makes absolutely sense, we should be doing this in the HTTPClient which will always have the session created by itself.","accounts_in_message":[],"_revision_number":1},{"id":"75cf210a4722f4e3edc3c04440940179234eebdc","author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"date":"2019-12-11 06:35:39.000000000","message":"Patch Set 1: Code-Review+2 Workflow+1\n\nThank you Alex!!","accounts_in_message":[],"_revision_number":1},{"id":"e69c1b97705a16152301ddd6db0cebcd1d7ae2b7","tag":"autogenerated:zuul:gate","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-12-11 06:35:50.000000000","message":"Patch Set 1: -Verified\n\nStarting gate jobs.","accounts_in_message":[],"_revision_number":1},{"id":"a4a63b951b33aefc969c8c774f6d6c3a68464965","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-12-11 08:16:27.000000000","message":"Change has been successfully merged by Zuul","accounts_in_message":[],"_revision_number":1},{"id":"1dc6669c44ba0fb472f953e2b59412fd6c5bd5fa","tag":"autogenerated:zuul:gate","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-12-11 08:16:27.000000000","message":"Patch Set 1: Verified+2\n\nBuild succeeded (gate pipeline).\n\n- tempest-full https://zuul.opendev.org/t/openstack/build/a064807457c54d5084105712c17d3083 : SUCCESS in 1h 35m 11s\n- tempest-full-py3 https://zuul.opendev.org/t/openstack/build/58ac7cb97ac14c28b895f75cfaf089c4 : SUCCESS in 1h 28m 42s\n- openstack-tox-lower-constraints https://zuul.opendev.org/t/openstack/build/ffe77c71a97e453da9ed29aa643c3195 : SUCCESS in 3m 15s\n- openstack-tox-pep8 https://zuul.opendev.org/t/openstack/build/ab2a279823a84444a405587043984751 : SUCCESS in 3m 07s\n- openstack-tox-py27 https://zuul.opendev.org/t/openstack/build/21e1c50dfa79486885dd577801ca8d72 : SUCCESS in 2m 55s\n- openstack-tox-py36 https://zuul.opendev.org/t/openstack/build/e196ddf9cb914215b5a662c19454d184 : SUCCESS in 5m 28s\n- openstack-tox-py37 https://zuul.opendev.org/t/openstack/build/141d16744a614f158b0232d027d1d742 : SUCCESS in 8m 17s\n- openstack-tox-docs https://zuul.opendev.org/t/openstack/build/e4cb6b35d7524afba3689b5c3231c4ad : SUCCESS in 4m 44s\n- glanceclient-dsvm-functional-v1 https://zuul.opendev.org/t/openstack/build/102fdea672ac4f20a6bec3269a2f1c3f : SUCCESS in 41m 12s\n- glanceclient-dsvm-functional https://zuul.opendev.org/t/openstack/build/f7b571012332427daa0a8bb760873432 : SUCCESS in 36m 59s","accounts_in_message":[],"_revision_number":1},{"id":"6871b5d23a9d89a9ccf0a0ee5cec8cb25abaa8a7","tag":"autogenerated:zuul:promote","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-12-11 08:18:40.000000000","message":"Patch Set 1:\n\nBuild succeeded (promote pipeline).\n\n- promote-openstack-tox-docs https://zuul.opendev.org/t/openstack/build/e27bd16189d14d44976b3db6b6d4a9a3 : SUCCESS in 56s","accounts_in_message":[],"_revision_number":1}],"current_revision_number":1,"current_revision":"436f797e8db2fc11b7dace7cb7020e4d44a3d2d7","revisions":{"436f797e8db2fc11b7dace7cb7020e4d44a3d2d7":{"kind":"REWORK","_number":1,"created":"2019-08-01 20:41:29.000000000","uploader":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"ref":"refs/changes/33/674133/1","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/python-glanceclient","ref":"refs/changes/33/674133/1","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/python-glanceclient refs/changes/33/674133/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/python-glanceclient refs/changes/33/674133/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/python-glanceclient refs/changes/33/674133/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/python-glanceclient refs/changes/33/674133/1"}}},"commit":{"parents":[{"commit":"31f2fdae9481c7fd840219887c27d6f696f819ab","subject":"Merge \"Modify the url of upper_constraints_file\"","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/python-glanceclient/commit/31f2fdae9481c7fd840219887c27d6f696f819ab"}]}],"author":{"name":"Alex Schultz","email":"aschultz@redhat.com","date":"2019-08-01 20:39:46.000000000","tz":-360},"committer":{"name":"Alex Schultz","email":"aschultz@redhat.com","date":"2019-08-01 20:41:29.000000000","tz":-360},"subject":"Cleanup session object","message":"Cleanup session object\n\nIf a session object is not provided to the get_http_client function (as\nis done via osc), the glance client uses it\u0027s own HTTPClient class. This\nclass creates a session but does not properly close it when it is done.\nThis can lead to resource warnings about unclosed sockets. This change\nadds a __del__() to the HTTPClient class to close out the session\ncorrectly.\n\nChange-Id: Idccff338fa84c46ca0e429bb533a2a5217205eef\nCloses-Bug: #1838694\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/python-glanceclient/commit/436f797e8db2fc11b7dace7cb7020e4d44a3d2d7"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/python-glanceclient/commit/436f797e8db2fc11b7dace7cb7020e4d44a3d2d7"}]},"branch":"refs/heads/master"}},"requirements":[],"submit_records":[],"submit_requirements":[]}
