)]}'
{"ironic/drivers/modules/redfish/utils.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e090c55b8d40a0eda03b9ae148dc8701a4a6e4ee","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        wait_fixed\u003dCONF.redfish.connection_retry_interval * 1000)"},{"line_number":184,"context_line":"    def _get_system():"},{"line_number":185,"context_line":"        auth_type \u003d driver_info[\u0027auth_type\u0027]"},{"line_number":186,"context_line":"        session_key \u003d frozenset("},{"line_number":187,"context_line":"            (k, driver_info.get(k)) for k in (\u0027address\u0027, \u0027auth_type\u0027,"},{"line_number":188,"context_line":"                                              \u0027username\u0027, \u0027password\u0027)"},{"line_number":189,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_97a75bbd","line":186,"updated":"2018-09-26 13:38:38.000000000","message":"let\u0027s just have a tuple of address, username, auth_type. a frozenset is a bit of an overkill.","commit_id":"a6aa02a0266385da029331d0697332e9f16a6b7b"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"e770cb961f06492083dfa306a397433af77ef976","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        wait_fixed\u003dCONF.redfish.connection_retry_interval * 1000)"},{"line_number":184,"context_line":"    def _get_system():"},{"line_number":185,"context_line":"        auth_type \u003d driver_info[\u0027auth_type\u0027]"},{"line_number":186,"context_line":"        session_key \u003d frozenset("},{"line_number":187,"context_line":"            (k, driver_info.get(k)) for k in (\u0027address\u0027, \u0027auth_type\u0027,"},{"line_number":188,"context_line":"                                              \u0027username\u0027, \u0027password\u0027)"},{"line_number":189,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_4d705674","line":186,"in_reply_to":"3f79a3b5_97a75bbd","updated":"2018-09-27 06:02:39.000000000","message":"Done","commit_id":"a6aa02a0266385da029331d0697332e9f16a6b7b"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e090c55b8d40a0eda03b9ae148dc8701a4a6e4ee","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        auth_type \u003d driver_info[\u0027auth_type\u0027]"},{"line_number":186,"context_line":"        session_key \u003d frozenset("},{"line_number":187,"context_line":"            (k, driver_info.get(k)) for k in (\u0027address\u0027, \u0027auth_type\u0027,"},{"line_number":188,"context_line":"                                              \u0027username\u0027, \u0027password\u0027)"},{"line_number":189,"context_line":"        )"},{"line_number":190,"context_line":"        try:"},{"line_number":191,"context_line":"            # NOTE(etingof): is this racy and needs locking?"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_b7aa9781","line":188,"updated":"2018-09-26 13:38:38.000000000","message":"I don\u0027t think we need a password here","commit_id":"a6aa02a0266385da029331d0697332e9f16a6b7b"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"e770cb961f06492083dfa306a397433af77ef976","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        auth_type \u003d driver_info[\u0027auth_type\u0027]"},{"line_number":186,"context_line":"        session_key \u003d frozenset("},{"line_number":187,"context_line":"            (k, driver_info.get(k)) for k in (\u0027address\u0027, \u0027auth_type\u0027,"},{"line_number":188,"context_line":"                                              \u0027username\u0027, \u0027password\u0027)"},{"line_number":189,"context_line":"        )"},{"line_number":190,"context_line":"        try:"},{"line_number":191,"context_line":"            # NOTE(etingof): is this racy and needs locking?"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_2d65daaf","line":188,"in_reply_to":"3f79a3b5_b7aa9781","updated":"2018-09-27 06:02:39.000000000","message":"Done","commit_id":"a6aa02a0266385da029331d0697332e9f16a6b7b"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e090c55b8d40a0eda03b9ae148dc8701a4a6e4ee","unresolved":false,"context_lines":[{"line_number":188,"context_line":"                                              \u0027username\u0027, \u0027password\u0027)"},{"line_number":189,"context_line":"        )"},{"line_number":190,"context_line":"        try:"},{"line_number":191,"context_line":"            # NOTE(etingof): is this racy and needs locking?"},{"line_number":192,"context_line":"            authenticator \u003d _sessions[session_key]"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_5791c352","line":191,"updated":"2018-09-26 13:38:38.000000000","message":"I don\u0027t think so. Even in case of a racy, we just end up creating sessions twice. But with green threads this code should not be racy as nothing here causes a thread switch.","commit_id":"a6aa02a0266385da029331d0697332e9f16a6b7b"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"e770cb961f06492083dfa306a397433af77ef976","unresolved":false,"context_lines":[{"line_number":188,"context_line":"                                              \u0027username\u0027, \u0027password\u0027)"},{"line_number":189,"context_line":"        )"},{"line_number":190,"context_line":"        try:"},{"line_number":191,"context_line":"            # NOTE(etingof): is this racy and needs locking?"},{"line_number":192,"context_line":"            authenticator \u003d _sessions[session_key]"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_4df5b6cb","line":191,"in_reply_to":"3f79a3b5_5791c352","updated":"2018-09-27 06:02:39.000000000","message":"Done","commit_id":"a6aa02a0266385da029331d0697332e9f16a6b7b"},{"author":{"_account_id":11076,"name":"Shivanand Tendulker","email":"stendulker@gmail.com","username":"stendulker"},"change_message_id":"c664c112a38c59ff05b466aca3cd6a5a42910e8b","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            \u0027node_uuid\u0027: node.uuid}"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"# Cache of HTTP sessions credentials"},{"line_number":152,"context_line":"_sessions \u003d {}"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"def get_system(node):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_2480859c","line":152,"range":{"start_line":152,"start_character":0,"end_line":152,"end_character":14},"updated":"2018-09-27 05:38:41.000000000","message":"When do we clear this cache? Or should we restrict it to certain number of records? Or would it be better to keep it in driver_internal_info so that it gets cleared upon node delete?","commit_id":"3a48f0c0484ee884c41b2f0af1658f145b2bd261"},{"author":{"_account_id":22623,"name":"Erik Olof Gunnar Andersson","email":"eandersson@blizzard.com","username":"eoandersson"},"change_message_id":"ffbb84aef29aa82ee8172e3b97fa1a3f871d9db7","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            \u0027node_uuid\u0027: node.uuid}"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"# Cache of HTTP sessions credentials"},{"line_number":152,"context_line":"_sessions \u003d {}"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"def get_system(node):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_5f08ea25","line":152,"range":{"start_line":152,"start_character":0,"end_line":152,"end_character":14},"in_reply_to":"3f79a3b5_2480859c","updated":"2018-09-27 05:50:37.000000000","message":"This should be upper case as well, and on top.\n\nIt should probably look closer to how the Keystone Sessions are stored, e.g.\nhttp://git.openstack.org/cgit/openstack/ironic/tree/ironic/common/cinder.py#n32","commit_id":"3a48f0c0484ee884c41b2f0af1658f145b2bd261"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"8b41eec3484da1d88e3bedf529e1150647fa6cbb","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            \u0027node_uuid\u0027: node.uuid}"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"# Cache of HTTP sessions credentials"},{"line_number":152,"context_line":"_sessions \u003d {}"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"def get_system(node):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_c373c4e7","line":152,"range":{"start_line":152,"start_character":0,"end_line":152,"end_character":14},"in_reply_to":"3f79a3b5_2480859c","updated":"2018-09-27 09:20:21.000000000","message":"driver_internal_info might not be the best option because one BMC may serve multiple nodes...\n\nJust added simplistic expiration mechanics.","commit_id":"3a48f0c0484ee884c41b2f0af1658f145b2bd261"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"8b41eec3484da1d88e3bedf529e1150647fa6cbb","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            \u0027node_uuid\u0027: node.uuid}"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"# Cache of HTTP sessions credentials"},{"line_number":152,"context_line":"_sessions \u003d {}"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"def get_system(node):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_6331900a","line":152,"range":{"start_line":152,"start_character":0,"end_line":152,"end_character":14},"in_reply_to":"3f79a3b5_5f08ea25","updated":"2018-09-27 09:20:21.000000000","message":"Done","commit_id":"3a48f0c0484ee884c41b2f0af1658f145b2bd261"},{"author":{"_account_id":11076,"name":"Shivanand Tendulker","email":"stendulker@gmail.com","username":"stendulker"},"change_message_id":"c664c112a38c59ff05b466aca3cd6a5a42910e8b","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        session_key \u003d tuple("},{"line_number":173,"context_line":"            driver_info.get(key) for key in (\u0027address\u0027, \u0027username\u0027)"},{"line_number":174,"context_line":"        )"},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            authenticator \u003d _sessions[session_key]"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        except KeyError:"},{"line_number":179,"context_line":"            Authenticator \u003d sushy.auth.SessionOrBasicAuth"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"            authenticator \u003d Authenticator(username\u003ddriver_info[\u0027username\u0027],"},{"line_number":182,"context_line":"                                          password\u003ddriver_info[\u0027password\u0027])"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"            _sessions[session_key] \u003d authenticator"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            conn \u003d sushy.Sushy("}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_a4c6d514","line":184,"range":{"start_line":175,"start_character":7,"end_line":184,"end_character":50},"updated":"2018-09-27 05:38:41.000000000","message":"Instead of try/except can we:-\nauthenticator \u003d _sessions.get(session_key)\nif not authenticator:\n    Authenticator \u003d sushy.auth.SessionOrBasicAuth\n    authenticator \u003d Authenticator(username\u003ddriver_info[\u0027username\u0027], password\u003ddriver_info[\u0027password\u0027])\n    _sessions[session_key] \u003d authenticator","commit_id":"3a48f0c0484ee884c41b2f0af1658f145b2bd261"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"8b41eec3484da1d88e3bedf529e1150647fa6cbb","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        session_key \u003d tuple("},{"line_number":173,"context_line":"            driver_info.get(key) for key in (\u0027address\u0027, \u0027username\u0027)"},{"line_number":174,"context_line":"        )"},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            authenticator \u003d _sessions[session_key]"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        except KeyError:"},{"line_number":179,"context_line":"            Authenticator \u003d sushy.auth.SessionOrBasicAuth"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"            authenticator \u003d Authenticator(username\u003ddriver_info[\u0027username\u0027],"},{"line_number":182,"context_line":"                                          password\u003ddriver_info[\u0027password\u0027])"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"            _sessions[session_key] \u003d authenticator"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            conn \u003d sushy.Sushy("}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_c66672ef","line":184,"range":{"start_line":175,"start_character":7,"end_line":184,"end_character":50},"in_reply_to":"3f79a3b5_a4c6d514","updated":"2018-09-27 09:20:21.000000000","message":"Done","commit_id":"3a48f0c0484ee884c41b2f0af1658f145b2bd261"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"d591187d41faffcb8454d9f72f65f664539d0cf1","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            authenticator \u003d Authenticator(username\u003ddriver_info[\u0027username\u0027],"},{"line_number":183,"context_line":"                                          password\u003ddriver_info[\u0027password\u0027])"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"            # Expire a quarter of old sessions at once"},{"line_number":186,"context_line":"            if len(_SESSIONS) \u003e\u003d _MAX_SESSIONS:"},{"line_number":187,"context_line":"                drop_sessions \u003d list(_SESSIONS)"},{"line_number":188,"context_line":"                drop_sessions \u003d drop_sessions[:_MAX_SESSIONS // 4]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_06b54a7e","line":185,"updated":"2018-09-27 09:51:48.000000000","message":"I wonder if there is a ready-to-use structure for this..","commit_id":"bc7a13c861465cd1ba31251c115eee287fdd10f7"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"141eb9da92453c54b896b94d4e73c841fb3390fc","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            authenticator \u003d Authenticator(username\u003ddriver_info[\u0027username\u0027],"},{"line_number":183,"context_line":"                                          password\u003ddriver_info[\u0027password\u0027])"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"            # Expire a quarter of old sessions at once"},{"line_number":186,"context_line":"            if len(_SESSIONS) \u003e\u003d _MAX_SESSIONS:"},{"line_number":187,"context_line":"                drop_sessions \u003d list(_SESSIONS)"},{"line_number":188,"context_line":"                drop_sessions \u003d drop_sessions[:_MAX_SESSIONS // 4]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_a942293a","line":185,"in_reply_to":"3f79a3b5_06b54a7e","updated":"2018-09-27 10:03:51.000000000","message":"I\u0027ve googled a bit on this, it seems like people use OrderedDict [1] for that (apart from third-party packages).\n\n1. https://stackoverflow.com/questions/2437617/limiting-the-size-of-a-python-dictionary","commit_id":"bc7a13c861465cd1ba31251c115eee287fdd10f7"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"abbb2d196dec8c985adbd1e38b2be56164598009","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            authenticator \u003d Authenticator(username\u003ddriver_info[\u0027username\u0027],"},{"line_number":183,"context_line":"                                          password\u003ddriver_info[\u0027password\u0027])"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"            # Expire a quarter of old sessions at once"},{"line_number":186,"context_line":"            if len(_SESSIONS) \u003e\u003d _MAX_SESSIONS:"},{"line_number":187,"context_line":"                drop_sessions \u003d list(_SESSIONS)"},{"line_number":188,"context_line":"                drop_sessions \u003d drop_sessions[:_MAX_SESSIONS // 4]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_bbaee42c","line":185,"in_reply_to":"3f79a3b5_89516ddc","updated":"2018-09-27 16:49:27.000000000","message":"Done","commit_id":"bc7a13c861465cd1ba31251c115eee287fdd10f7"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"0cfcbded4de03aa31ab8458640444b7356e3a122","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            authenticator \u003d Authenticator(username\u003ddriver_info[\u0027username\u0027],"},{"line_number":183,"context_line":"                                          password\u003ddriver_info[\u0027password\u0027])"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"            # Expire a quarter of old sessions at once"},{"line_number":186,"context_line":"            if len(_SESSIONS) \u003e\u003d _MAX_SESSIONS:"},{"line_number":187,"context_line":"                drop_sessions \u003d list(_SESSIONS)"},{"line_number":188,"context_line":"                drop_sessions \u003d drop_sessions[:_MAX_SESSIONS // 4]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_89516ddc","line":185,"in_reply_to":"3f79a3b5_a942293a","updated":"2018-09-27 10:13:06.000000000","message":"++","commit_id":"bc7a13c861465cd1ba31251c115eee287fdd10f7"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"d591187d41faffcb8454d9f72f65f664539d0cf1","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"            # Expire a quarter of old sessions at once"},{"line_number":186,"context_line":"            if len(_SESSIONS) \u003e\u003d _MAX_SESSIONS:"},{"line_number":187,"context_line":"                drop_sessions \u003d list(_SESSIONS)"},{"line_number":188,"context_line":"                drop_sessions \u003d drop_sessions[:_MAX_SESSIONS // 4]"},{"line_number":189,"context_line":"                for session in drop_sessions:"},{"line_number":190,"context_line":"                    del _SESSIONS[session]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_26b88673","line":187,"updated":"2018-09-27 09:51:48.000000000","message":"let\u0027s store a timestamp, sort by it and drop the oldest. otherwise we risk removing the active sessions, while keeping the long expired ones","commit_id":"bc7a13c861465cd1ba31251c115eee287fdd10f7"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"141eb9da92453c54b896b94d4e73c841fb3390fc","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"            # Expire a quarter of old sessions at once"},{"line_number":186,"context_line":"            if len(_SESSIONS) \u003e\u003d _MAX_SESSIONS:"},{"line_number":187,"context_line":"                drop_sessions \u003d list(_SESSIONS)"},{"line_number":188,"context_line":"                drop_sessions \u003d drop_sessions[:_MAX_SESSIONS // 4]"},{"line_number":189,"context_line":"                for session in drop_sessions:"},{"line_number":190,"context_line":"                    del _SESSIONS[session]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_2909392a","line":187,"in_reply_to":"3f79a3b5_26b88673","updated":"2018-09-27 10:03:51.000000000","message":"So here we expire sessions by age, not by activity. May be it actually better reflects how web sessions work - expire over time even if being used to enforce token refresh.\n\nWDYT?\n\nThe missing thing here is to cease the session with BMC - this is what I gonna address shortly.","commit_id":"bc7a13c861465cd1ba31251c115eee287fdd10f7"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"0cfcbded4de03aa31ab8458640444b7356e3a122","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"            # Expire a quarter of old sessions at once"},{"line_number":186,"context_line":"            if len(_SESSIONS) \u003e\u003d _MAX_SESSIONS:"},{"line_number":187,"context_line":"                drop_sessions \u003d list(_SESSIONS)"},{"line_number":188,"context_line":"                drop_sessions \u003d drop_sessions[:_MAX_SESSIONS // 4]"},{"line_number":189,"context_line":"                for session in drop_sessions:"},{"line_number":190,"context_line":"                    del _SESSIONS[session]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_e942610d","line":187,"in_reply_to":"3f79a3b5_2909392a","updated":"2018-09-27 10:13:06.000000000","message":"\u003e May be it actually better reflects how web sessions work - expire over time even if being used to enforce token refresh.\n\nThis is essentially my suggestion, right? And yes, an OrderedDict will probably help.\n\n\u003e The missing thing here is to cease the session with BMC - this is what I gonna address shortly.\n\nRight, this is also needed.\n\nMaybe move this cache to a separate class for clarity?","commit_id":"bc7a13c861465cd1ba31251c115eee287fdd10f7"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"abbb2d196dec8c985adbd1e38b2be56164598009","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"            # Expire a quarter of old sessions at once"},{"line_number":186,"context_line":"            if len(_SESSIONS) \u003e\u003d _MAX_SESSIONS:"},{"line_number":187,"context_line":"                drop_sessions \u003d list(_SESSIONS)"},{"line_number":188,"context_line":"                drop_sessions \u003d drop_sessions[:_MAX_SESSIONS // 4]"},{"line_number":189,"context_line":"                for session in drop_sessions:"},{"line_number":190,"context_line":"                    del _SESSIONS[session]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_fb69bcf7","line":187,"in_reply_to":"3f79a3b5_747624a6","updated":"2018-09-27 16:49:27.000000000","message":"Done","commit_id":"bc7a13c861465cd1ba31251c115eee287fdd10f7"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"3ba3c6e354dba6778045d58cc7bea793bdf21ae3","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"            # Expire a quarter of old sessions at once"},{"line_number":186,"context_line":"            if len(_SESSIONS) \u003e\u003d _MAX_SESSIONS:"},{"line_number":187,"context_line":"                drop_sessions \u003d list(_SESSIONS)"},{"line_number":188,"context_line":"                drop_sessions \u003d drop_sessions[:_MAX_SESSIONS // 4]"},{"line_number":189,"context_line":"                for session in drop_sessions:"},{"line_number":190,"context_line":"                    del _SESSIONS[session]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_747624a6","line":187,"in_reply_to":"3f79a3b5_89facd40","updated":"2018-09-27 10:56:15.000000000","message":"\u003e I\u0027ve read your suggestion as to expire sessions based on the earliest *used* criterion, not on the earliest *created*. \n\nI\u0027m fine either way.","commit_id":"bc7a13c861465cd1ba31251c115eee287fdd10f7"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"abbb2d196dec8c985adbd1e38b2be56164598009","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"            # Expire a quarter of old sessions at once"},{"line_number":186,"context_line":"            if len(_SESSIONS) \u003e\u003d _MAX_SESSIONS:"},{"line_number":187,"context_line":"                drop_sessions \u003d list(_SESSIONS)"},{"line_number":188,"context_line":"                drop_sessions \u003d drop_sessions[:_MAX_SESSIONS // 4]"},{"line_number":189,"context_line":"                for session in drop_sessions:"},{"line_number":190,"context_line":"                    del _SESSIONS[session]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_3b60940d","line":187,"in_reply_to":"3f79a3b5_e942610d","updated":"2018-09-27 16:49:27.000000000","message":"\u003e Right, this is also needed.\n\nDone\n\n\u003e Maybe move this cache to a separate class for clarity?\n\nDone","commit_id":"bc7a13c861465cd1ba31251c115eee287fdd10f7"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"fbb5d885b701d22467420abe30864b6ed3c08484","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"            # Expire a quarter of old sessions at once"},{"line_number":186,"context_line":"            if len(_SESSIONS) \u003e\u003d _MAX_SESSIONS:"},{"line_number":187,"context_line":"                drop_sessions \u003d list(_SESSIONS)"},{"line_number":188,"context_line":"                drop_sessions \u003d drop_sessions[:_MAX_SESSIONS // 4]"},{"line_number":189,"context_line":"                for session in drop_sessions:"},{"line_number":190,"context_line":"                    del _SESSIONS[session]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_89facd40","line":187,"in_reply_to":"3f79a3b5_e942610d","updated":"2018-09-27 10:42:29.000000000","message":"\u003e This is essentially my suggestion, right? And yes, an OrderedDict will probably help.\n\nI\u0027ve read your suggestion as to expire sessions based on the earliest *used* criterion, not on the earliest *created*. \n\nSo we\u0027d need to update timestamps on each session use (or del+add session_key into OrderedDict) to keep active connections away from the killing slicer.\n\nBut I am not sure we should used the earliest used criterion here based on the crypto material ageing consideration.\n\nThe other thought is that killing an innocent session may not be that a capital offence for as long as we close it at the BMC.","commit_id":"bc7a13c861465cd1ba31251c115eee287fdd10f7"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"d591187d41faffcb8454d9f72f65f664539d0cf1","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                drop_sessions \u003d list(_SESSIONS)"},{"line_number":188,"context_line":"                drop_sessions \u003d drop_sessions[:_MAX_SESSIONS // 4]"},{"line_number":189,"context_line":"                for session in drop_sessions:"},{"line_number":190,"context_line":"                    del _SESSIONS[session]"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"            _SESSIONS[session_key] \u003d authenticator"},{"line_number":193,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_c6ae722e","line":190,"updated":"2018-09-27 09:51:48.000000000","message":"This code is (theoretically) racy, so let\u0027s handle KeyError","commit_id":"bc7a13c861465cd1ba31251c115eee287fdd10f7"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"fbb5d885b701d22467420abe30864b6ed3c08484","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                drop_sessions \u003d list(_SESSIONS)"},{"line_number":188,"context_line":"                drop_sessions \u003d drop_sessions[:_MAX_SESSIONS // 4]"},{"line_number":189,"context_line":"                for session in drop_sessions:"},{"line_number":190,"context_line":"                    del _SESSIONS[session]"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"            _SESSIONS[session_key] \u003d authenticator"},{"line_number":193,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_89608dd1","line":190,"in_reply_to":"3f79a3b5_c6ae722e","updated":"2018-09-27 10:42:29.000000000","message":"Done","commit_id":"bc7a13c861465cd1ba31251c115eee287fdd10f7"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"1b60f16ac4066d22d7688deeed713e325ab874c9","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"class SessionCache(object):"},{"line_number":154,"context_line":"    \"\"\"Cache of HTTP sessions credentials\"\"\""},{"line_number":155,"context_line":"    MAX_SESSIONS \u003d 100"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    sessions \u003d collections.OrderedDict()"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_e134a64b","line":155,"updated":"2018-09-28 00:28:49.000000000","message":"Why 100? Operators publicly talk 200-300 baremetal nodes with ipmitool being executed. Redfish being python native for us, the possible numbers are much higher without the ipmitool execution...  One midsize operator I\u0027ve spoken to is pushing 550-650 nodes per conductor.","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"40e4d0f86c1ba797cd2ef69b9fda3d8f7ed8a8ec","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"class SessionCache(object):"},{"line_number":154,"context_line":"    \"\"\"Cache of HTTP sessions credentials\"\"\""},{"line_number":155,"context_line":"    MAX_SESSIONS \u003d 100"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    sessions \u003d collections.OrderedDict()"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_ab92eb9d","line":155,"in_reply_to":"3f79a3b5_1c8a6419","updated":"2018-09-29 13:30:23.000000000","message":"That is kind of what I\u0027m thinking, the configuration cost outweighs the wall the medium to large scale operators will encounter... and the default should work for the vast majority of cases. Then again, maybe we want to start with a slightly larger number? I feel like this is bike shedding, and I feel bad because of that, but at the same time... we won\u0027t be able to backport configuration.","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"678e80e1943f210ec31ed753f6be1f894602378c","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"class SessionCache(object):"},{"line_number":154,"context_line":"    \"\"\"Cache of HTTP sessions credentials\"\"\""},{"line_number":155,"context_line":"    MAX_SESSIONS \u003d 100"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    sessions \u003d collections.OrderedDict()"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_68736fb5","line":155,"in_reply_to":"3f79a3b5_ab92eb9d","updated":"2018-09-30 08:01:51.000000000","message":"\u003e we won\u0027t be able to backport configuration\n\nWe have a history of backporting new configuration options required for bug fixes.","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4e5f6428571da88a9feb43999b14e8c60c22515e","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"class SessionCache(object):"},{"line_number":154,"context_line":"    \"\"\"Cache of HTTP sessions credentials\"\"\""},{"line_number":155,"context_line":"    MAX_SESSIONS \u003d 100"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    sessions \u003d collections.OrderedDict()"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_afae66e1","line":155,"in_reply_to":"3f79a3b5_ab92eb9d","updated":"2018-10-01 09:56:49.000000000","message":"I am not sure that a dedicated configuration option for this setting makes a lot of sense. I feel like we still have some room for larger session cache given that:\n\n* we cache just a simple pure Python object, not sockets or alike\n* we cache only session authentication objects (not basic auth)\n* the way we expire sessions is relatively cheap (FIFO)\n\nSo may be just push cache size up to the largest possible node fleet? Is 1K nodes already beyond the reasonable number?\n\nWDYT?","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":22623,"name":"Erik Olof Gunnar Andersson","email":"eandersson@blizzard.com","username":"eoandersson"},"change_message_id":"73a74cdb9c40f3bd01a4e8df408650d418409888","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"class SessionCache(object):"},{"line_number":154,"context_line":"    \"\"\"Cache of HTTP sessions credentials\"\"\""},{"line_number":155,"context_line":"    MAX_SESSIONS \u003d 100"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    sessions \u003d collections.OrderedDict()"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_d16ef194","line":155,"in_reply_to":"3f79a3b5_ab92eb9d","updated":"2018-09-29 20:20:04.000000000","message":"Yea - I agree. I feel like the side-effects of a higher number outweighs the potential side-effects of a lower.","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4e5f6428571da88a9feb43999b14e8c60c22515e","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"class SessionCache(object):"},{"line_number":154,"context_line":"    \"\"\"Cache of HTTP sessions credentials\"\"\""},{"line_number":155,"context_line":"    MAX_SESSIONS \u003d 100"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    sessions \u003d collections.OrderedDict()"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_cf6642ef","line":155,"in_reply_to":"3f79a3b5_e134a64b","updated":"2018-10-01 09:56:49.000000000","message":"Right, let\u0027s push it up to 1000. That should not cost much I think.","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":22623,"name":"Erik Olof Gunnar Andersson","email":"eandersson@blizzard.com","username":"eoandersson"},"change_message_id":"c1c8e954a9e0b46d81179f665b73409e9b94fbca","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"class SessionCache(object):"},{"line_number":154,"context_line":"    \"\"\"Cache of HTTP sessions credentials\"\"\""},{"line_number":155,"context_line":"    MAX_SESSIONS \u003d 100"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    sessions \u003d collections.OrderedDict()"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_1c8a6419","line":155,"in_reply_to":"3f79a3b5_e134a64b","updated":"2018-09-28 05:51:15.000000000","message":"This could probably be a configuration option?","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":22623,"name":"Erik Olof Gunnar Andersson","email":"eandersson@blizzard.com","username":"eoandersson"},"change_message_id":"c1c8e954a9e0b46d81179f665b73409e9b94fbca","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        authenticator \u003d self.sessions.get(session_key)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        if not authenticator:"},{"line_number":171,"context_line":"            # Expire a quarter of oldest sessions at once"},{"line_number":172,"context_line":"            if len(self.sessions) \u003e\u003d self.MAX_SESSIONS:"},{"line_number":173,"context_line":"                drop_sessions \u003d list(self.sessions)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_5c6f7c5f","line":170,"updated":"2018-09-28 05:51:15.000000000","message":"This could just be combined into one if statement.\n\u003e if not authenticator and len(self.sessions) \u003e\u003d self.MAX_SESSIONS:","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4e5f6428571da88a9feb43999b14e8c60c22515e","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        authenticator \u003d self.sessions.get(session_key)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        if not authenticator:"},{"line_number":171,"context_line":"            # Expire a quarter of oldest sessions at once"},{"line_number":172,"context_line":"            if len(self.sessions) \u003e\u003d self.MAX_SESSIONS:"},{"line_number":173,"context_line":"                drop_sessions \u003d list(self.sessions)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_6feb6e11","line":170,"in_reply_to":"3f79a3b5_5c6f7c5f","updated":"2018-10-01 09:56:49.000000000","message":"Hmmm, can it? The first condition applies to line 194 and beyond...\n\nAnyway, moved to a method.","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":22623,"name":"Erik Olof Gunnar Andersson","email":"eandersson@blizzard.com","username":"eoandersson"},"change_message_id":"ad6fb1ac91e7d037b56ba85f1d01d8a7f0c295f0","unresolved":false,"context_lines":[{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        if not authenticator:"},{"line_number":171,"context_line":"            # Expire a quarter of oldest sessions at once"},{"line_number":172,"context_line":"            if len(self.sessions) \u003e\u003d self.MAX_SESSIONS:"},{"line_number":173,"context_line":"                drop_sessions \u003d list(self.sessions)"},{"line_number":174,"context_line":"                drop_sessions \u003d drop_sessions[:self.MAX_SESSIONS // 4]"},{"line_number":175,"context_line":"                for session_key in drop_sessions:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_5c969c4b","line":172,"updated":"2018-09-28 05:45:08.000000000","message":"Could we just move this into a separate function? If we use a class for this, we might as well make use of it\u0027s constructs to make the code easier to read.","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4e5f6428571da88a9feb43999b14e8c60c22515e","unresolved":false,"context_lines":[{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        if not authenticator:"},{"line_number":171,"context_line":"            # Expire a quarter of oldest sessions at once"},{"line_number":172,"context_line":"            if len(self.sessions) \u003e\u003d self.MAX_SESSIONS:"},{"line_number":173,"context_line":"                drop_sessions \u003d list(self.sessions)"},{"line_number":174,"context_line":"                drop_sessions \u003d drop_sessions[:self.MAX_SESSIONS // 4]"},{"line_number":175,"context_line":"                for session_key in drop_sessions:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_af63c6aa","line":172,"in_reply_to":"3f79a3b5_5c969c4b","updated":"2018-10-01 09:56:49.000000000","message":"Done","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":22623,"name":"Erik Olof Gunnar Andersson","email":"eandersson@blizzard.com","username":"eoandersson"},"change_message_id":"73a74cdb9c40f3bd01a4e8df408650d418409888","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            # Expire a quarter of oldest sessions at once"},{"line_number":172,"context_line":"            if len(self.sessions) \u003e\u003d self.MAX_SESSIONS:"},{"line_number":173,"context_line":"                drop_sessions \u003d list(self.sessions)"},{"line_number":174,"context_line":"                drop_sessions \u003d drop_sessions[:self.MAX_SESSIONS // 4]"},{"line_number":175,"context_line":"                for session_key in drop_sessions:"},{"line_number":176,"context_line":"                    _authenticator \u003d self.sessions.pop(session_key, None)"},{"line_number":177,"context_line":"                    if isinstance(_authenticator, sushy.auth.SessionAuth):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_5108a1d7","line":174,"updated":"2018-09-29 20:20:04.000000000","message":"1/4th sounds a little excessive to me. Why not just the more traditional approach and just pop the oldest entry?","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4e5f6428571da88a9feb43999b14e8c60c22515e","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            # Expire a quarter of oldest sessions at once"},{"line_number":172,"context_line":"            if len(self.sessions) \u003e\u003d self.MAX_SESSIONS:"},{"line_number":173,"context_line":"                drop_sessions \u003d list(self.sessions)"},{"line_number":174,"context_line":"                drop_sessions \u003d drop_sessions[:self.MAX_SESSIONS // 4]"},{"line_number":175,"context_line":"                for session_key in drop_sessions:"},{"line_number":176,"context_line":"                    _authenticator \u003d self.sessions.pop(session_key, None)"},{"line_number":177,"context_line":"                    if isinstance(_authenticator, sushy.auth.SessionAuth):"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_2fdb364e","line":174,"in_reply_to":"3f79a3b5_5108a1d7","updated":"2018-10-01 09:56:49.000000000","message":"Done","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":22623,"name":"Erik Olof Gunnar Andersson","email":"eandersson@blizzard.com","username":"eoandersson"},"change_message_id":"c1c8e954a9e0b46d81179f665b73409e9b94fbca","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                drop_sessions \u003d drop_sessions[:self.MAX_SESSIONS // 4]"},{"line_number":175,"context_line":"                for session_key in drop_sessions:"},{"line_number":176,"context_line":"                    _authenticator \u003d self.sessions.pop(session_key, None)"},{"line_number":177,"context_line":"                    if isinstance(_authenticator, sushy.auth.SessionAuth):"},{"line_number":178,"context_line":"                        _address, _username, _verify_ca \u003d session_key"},{"line_number":179,"context_line":"                        try:"},{"line_number":180,"context_line":"                            sushy.Sushy("}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_dc838c02","line":177,"updated":"2018-09-28 05:51:15.000000000","message":"This could be if not isinstance(..) continue to keep keep down the indentations.","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4e5f6428571da88a9feb43999b14e8c60c22515e","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                drop_sessions \u003d drop_sessions[:self.MAX_SESSIONS // 4]"},{"line_number":175,"context_line":"                for session_key in drop_sessions:"},{"line_number":176,"context_line":"                    _authenticator \u003d self.sessions.pop(session_key, None)"},{"line_number":177,"context_line":"                    if isinstance(_authenticator, sushy.auth.SessionAuth):"},{"line_number":178,"context_line":"                        _address, _username, _verify_ca \u003d session_key"},{"line_number":179,"context_line":"                        try:"},{"line_number":180,"context_line":"                            sushy.Sushy("}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_2f825600","line":177,"in_reply_to":"3f79a3b5_dc838c02","updated":"2018-10-01 09:56:49.000000000","message":"Done","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":22623,"name":"Erik Olof Gunnar Andersson","email":"eandersson@blizzard.com","username":"eoandersson"},"change_message_id":"c1c8e954a9e0b46d81179f665b73409e9b94fbca","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":"            Authenticator \u003d sushy.auth.SessionOrBasicAuth"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"            authenticator \u003d Authenticator("},{"line_number":197,"context_line":"                username\u003dself._driver_info[\u0027username\u0027],"},{"line_number":198,"context_line":"                password\u003dself._driver_info[\u0027password\u0027]"},{"line_number":199,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_bcaed07e","line":196,"updated":"2018-09-28 05:51:15.000000000","message":"Maybe just cleaner to do?\n\u003e authenticator \u003d sushy.auth.SessionOrBasicAuth(","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4e5f6428571da88a9feb43999b14e8c60c22515e","unresolved":false,"context_lines":[{"line_number":193,"context_line":""},{"line_number":194,"context_line":"            Authenticator \u003d sushy.auth.SessionOrBasicAuth"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"            authenticator \u003d Authenticator("},{"line_number":197,"context_line":"                username\u003dself._driver_info[\u0027username\u0027],"},{"line_number":198,"context_line":"                password\u003dself._driver_info[\u0027password\u0027]"},{"line_number":199,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_ef777e3a","line":196,"in_reply_to":"3f79a3b5_bcaed07e","updated":"2018-10-01 09:56:49.000000000","message":"Ah, that\u0027s the consequence of reordering patches. ;)\n\nChanged.","commit_id":"326dc036ca04561846e6487c21c62de14e9e1037"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"3cfb264f70d26d1e63cc273924ba2c3518989892","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        authenticator \u003d self.sessions.get(session_key)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        if not authenticator:"},{"line_number":171,"context_line":"            authenticator \u003d sushy.auth.SessionOrBasicAuth("},{"line_number":172,"context_line":"                username\u003dself._driver_info[\u0027username\u0027],"},{"line_number":173,"context_line":"                password\u003dself._driver_info[\u0027password\u0027]"},{"line_number":174,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_869edd66","line":171,"updated":"2018-10-02 08:44:14.000000000","message":"before I forget: this needs bumping sushy version in driver-requirements.txt to match one where SessionOrBasicAuth was introduced. That will make this fix not backportable :( Why cannot we cache the complete Sushy objects though? That would not require referring to SessionOrBasicAuth, making the patch backportable.","commit_id":"796890cf8db86cd414bd588a65917592f1528367"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"43792c3fdd6a2b4266d32c1f8d7df7afbff8dfd5","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        authenticator \u003d self.sessions.get(session_key)"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        if not authenticator:"},{"line_number":171,"context_line":"            authenticator \u003d sushy.auth.SessionOrBasicAuth("},{"line_number":172,"context_line":"                username\u003dself._driver_info[\u0027username\u0027],"},{"line_number":173,"context_line":"                password\u003dself._driver_info[\u0027password\u0027]"},{"line_number":174,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_1205247a","line":171,"in_reply_to":"3f79a3b5_869edd66","updated":"2018-10-02 11:55:10.000000000","message":"Good point!\n\nI\u0027ve re-tackled this code to make it working with older sushy.\n\nRE sushy object caching, I\u0027ve though about that but ended up with just auth object caching because:\n\n* If we cache the data (rather than connection), then it might not solve the session exhaustion problem, but introduces cache validity complications\n\n* If we cache `requests` connections (but not sushy data objects) that might have funny interplay with `requests` own connection caching/termination. Plus that might be heaver on memory/sockets (current cache size is 1K sessions).\n\nBecause of the above considerations, I feel like minimal auth object caching is easier, lighter and more manageable in the future.\n\nThoughts?","commit_id":"796890cf8db86cd414bd588a65917592f1528367"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"3cfb264f70d26d1e63cc273924ba2c3518989892","unresolved":false,"context_lines":[{"line_number":193,"context_line":"                for key in (\u0027address\u0027, \u0027username\u0027, \u0027verify_ca\u0027)"},{"line_number":194,"context_line":"            )"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"            # NOTE(etingof): failure may indicate expired session token"},{"line_number":197,"context_line":"            self.sessions.pop(session_key, None)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def _expire_oldest_session(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_a6a3d9b0","line":196,"updated":"2018-10-02 08:44:14.000000000","message":"if this happens, we must reauthenticate, not fail. but I think it\u0027s already handled by SessionAuth","commit_id":"796890cf8db86cd414bd588a65917592f1528367"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"43792c3fdd6a2b4266d32c1f8d7df7afbff8dfd5","unresolved":false,"context_lines":[{"line_number":193,"context_line":"                for key in (\u0027address\u0027, \u0027username\u0027, \u0027verify_ca\u0027)"},{"line_number":194,"context_line":"            )"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"            # NOTE(etingof): failure may indicate expired session token"},{"line_number":197,"context_line":"            self.sessions.pop(session_key, None)"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def _expire_oldest_session(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_b221d0fe","line":196,"in_reply_to":"3f79a3b5_a6a3d9b0","updated":"2018-10-02 11:55:10.000000000","message":"Right, re-authentication should happen under the sushy hood. So this is a fatal error, but may be it\u0027s still worth forgetting established session...?","commit_id":"796890cf8db86cd414bd588a65917592f1528367"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"3cfb264f70d26d1e63cc273924ba2c3518989892","unresolved":false,"context_lines":[{"line_number":205,"context_line":"            address, username, verify_ca \u003d session_key"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"            try:"},{"line_number":208,"context_line":"                sushy.Sushy("},{"line_number":209,"context_line":"                    address,"},{"line_number":210,"context_line":"                    verify\u003dverify_ca,"},{"line_number":211,"context_line":"                    auth\u003dauthenticator"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_46a445b8","line":208,"updated":"2018-10-02 08:44:14.000000000","message":"maybe a comment on why this is needed? I\u0027m not sure it is, all authenticators should have been connected to a Sushy object or removed at this point.","commit_id":"796890cf8db86cd414bd588a65917592f1528367"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"43792c3fdd6a2b4266d32c1f8d7df7afbff8dfd5","unresolved":false,"context_lines":[{"line_number":205,"context_line":"            address, username, verify_ca \u003d session_key"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"            try:"},{"line_number":208,"context_line":"                sushy.Sushy("},{"line_number":209,"context_line":"                    address,"},{"line_number":210,"context_line":"                    verify\u003dverify_ca,"},{"line_number":211,"context_line":"                    auth\u003dauthenticator"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_324e2096","line":208,"in_reply_to":"3f79a3b5_46a445b8","updated":"2018-10-02 11:55:10.000000000","message":"I tried to explain my thinking in the comment. WDYT?","commit_id":"796890cf8db86cd414bd588a65917592f1528367"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"3cfb264f70d26d1e63cc273924ba2c3518989892","unresolved":false,"context_lines":[{"line_number":214,"context_line":"                authenticator.close()"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"            except sushy.exceptions.ConnectionError as e:"},{"line_number":217,"context_line":"                LOG.debug(\u0027Failed to terminate Redfish session at \u0027"},{"line_number":218,"context_line":"                          \u0027%(username)s@%(address)s. Error %(error)s\u0027,"},{"line_number":219,"context_line":"                          {\u0027username\u0027: username, \u0027address\u0027: address,"},{"line_number":220,"context_line":"                           \u0027error\u0027: e})"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_66a9418d","line":217,"updated":"2018-10-02 08:44:14.000000000","message":"s/debug/warning/ (it\u0027s not a normal condition IMO)","commit_id":"796890cf8db86cd414bd588a65917592f1528367"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"43792c3fdd6a2b4266d32c1f8d7df7afbff8dfd5","unresolved":false,"context_lines":[{"line_number":214,"context_line":"                authenticator.close()"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"            except sushy.exceptions.ConnectionError as e:"},{"line_number":217,"context_line":"                LOG.debug(\u0027Failed to terminate Redfish session at \u0027"},{"line_number":218,"context_line":"                          \u0027%(username)s@%(address)s. Error %(error)s\u0027,"},{"line_number":219,"context_line":"                          {\u0027username\u0027: username, \u0027address\u0027: address,"},{"line_number":220,"context_line":"                           \u0027error\u0027: e})"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_925e1443","line":217,"in_reply_to":"3f79a3b5_66a9418d","updated":"2018-10-02 11:55:10.000000000","message":"Done","commit_id":"796890cf8db86cd414bd588a65917592f1528367"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"3cfb264f70d26d1e63cc273924ba2c3518989892","unresolved":false,"context_lines":[{"line_number":239,"context_line":"    def _get_system():"},{"line_number":240,"context_line":"        try:"},{"line_number":241,"context_line":"            with SessionCache(driver_info) as conn:"},{"line_number":242,"context_line":"                return conn.get_system(system_id)"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        except sushy.exceptions.ResourceNotFoundError as e:"},{"line_number":245,"context_line":"            LOG.error(\u0027The Redfish System \"%(system)s\" was not found for \u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_0692cd58","line":242,"updated":"2018-10-02 08:44:14.000000000","message":"Though unlikely, it may happen that we close the session this system is using if it\u0027s old enough.","commit_id":"796890cf8db86cd414bd588a65917592f1528367"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"43792c3fdd6a2b4266d32c1f8d7df7afbff8dfd5","unresolved":false,"context_lines":[{"line_number":239,"context_line":"    def _get_system():"},{"line_number":240,"context_line":"        try:"},{"line_number":241,"context_line":"            with SessionCache(driver_info) as conn:"},{"line_number":242,"context_line":"                return conn.get_system(system_id)"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        except sushy.exceptions.ResourceNotFoundError as e:"},{"line_number":245,"context_line":"            LOG.error(\u0027The Redfish System \"%(system)s\" was not found for \u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_1219a486","line":242,"in_reply_to":"3f79a3b5_0692cd58","updated":"2018-10-02 11:55:10.000000000","message":"So if we close the auth session, it would not be present in the cache what would trigger new session negotiation.\n\nI am not sure I got you right though.","commit_id":"796890cf8db86cd414bd588a65917592f1528367"},{"author":{"_account_id":11076,"name":"Shivanand Tendulker","email":"stendulker@gmail.com","username":"stendulker"},"change_message_id":"081fb7abe200cd527c6a46388f21c041e4a0d3d8","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                auth\u003dauthenticator"},{"line_number":175,"context_line":"            )"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        else:"},{"line_number":178,"context_line":"            # NOTE(etingof): this code should work with older sushy"},{"line_number":179,"context_line":"            if hasattr(sushy.auth, \u0027SessionOrBasicAuth\u0027):"},{"line_number":180,"context_line":"                authenticator \u003d sushy.auth.SessionOrBasicAuth("}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_f441380a","line":177,"range":{"start_line":177,"start_character":8,"end_line":177,"end_character":13},"updated":"2018-10-04 16:46:16.000000000","message":"May be we can add \u0027return conn\u0027 here instead of \u0027else\u0027.","commit_id":"419061369087ccd5c1c3a147d91a4a8ba620074b"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"205a48ba37ca3d7df2946debb68f2321dba01f64","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                auth\u003dauthenticator"},{"line_number":175,"context_line":"            )"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        else:"},{"line_number":178,"context_line":"            # NOTE(etingof): this code should work with older sushy"},{"line_number":179,"context_line":"            if hasattr(sushy.auth, \u0027SessionOrBasicAuth\u0027):"},{"line_number":180,"context_line":"                authenticator \u003d sushy.auth.SessionOrBasicAuth("}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_cabd3e04","line":177,"range":{"start_line":177,"start_character":8,"end_line":177,"end_character":13},"in_reply_to":"3f79a3b5_f441380a","updated":"2018-10-16 14:43:21.000000000","message":"Done","commit_id":"419061369087ccd5c1c3a147d91a4a8ba620074b"},{"author":{"_account_id":11076,"name":"Shivanand Tendulker","email":"stendulker@gmail.com","username":"stendulker"},"change_message_id":"081fb7abe200cd527c6a46388f21c041e4a0d3d8","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                if (hasattr(authenticator, \u0027get_session_key\u0027) and"},{"line_number":193,"context_line":"                        authenticator.get_session_key()):"},{"line_number":194,"context_line":"                    self._expire_oldest_session()"},{"line_number":195,"context_line":"                    self.sessions[session_key] \u003d authenticator"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"            else:"},{"line_number":198,"context_line":"                # NOTE(etingof): older sushy does not have auth object exposed"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_5a5a95f5","line":195,"range":{"start_line":195,"start_character":20,"end_line":195,"end_character":62},"updated":"2018-10-04 16:46:16.000000000","message":"Have you ensured that the session key inside this cached authenticator reflects the latest session key? The sushy has ability to recreate new session key if one has expired.\nhttps://github.com/openstack/sushy/blob/e96cb4e7a4e919f43af5886c3d3caf0ec493a977/sushy/connector.py#L97-L104","commit_id":"419061369087ccd5c1c3a147d91a4a8ba620074b"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"205a48ba37ca3d7df2946debb68f2321dba01f64","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                if (hasattr(authenticator, \u0027get_session_key\u0027) and"},{"line_number":193,"context_line":"                        authenticator.get_session_key()):"},{"line_number":194,"context_line":"                    self._expire_oldest_session()"},{"line_number":195,"context_line":"                    self.sessions[session_key] \u003d authenticator"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"            else:"},{"line_number":198,"context_line":"                # NOTE(etingof): older sushy does not have auth object exposed"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_419ba162","line":195,"range":{"start_line":195,"start_character":20,"end_line":195,"end_character":62},"in_reply_to":"3f79a3b5_5a5a95f5","updated":"2018-10-16 14:43:21.000000000","message":"It seems to me that in that case it still should work out.\n\nBoth ironic `SessionCache` and sushy `Connector` objects refer to that `authenticator` object. So they share it.\n\nThe `authenticator` object is mutable - it does not get re-created on session refresh, but its contents gets updated by sushy.\n\nIronic caches `authenticator by Redfish server endpoint, so whenever ironic talks to specific BMC it should get hold of the same `authenticator` object.\n\nNow, what happens when session token recycles:\n\n* SessionCache picks cached `authenticator` object by BMC address\n* New sushy connection is created, existing session token (taken from `authenticator`) is being used\n* Let\u0027s say the session key appears invalid, so sushy will reauthenticate and update `authenticator` object with newer session information\n* Since `SessionCache` still refers to the same `authenticator` object, next time ironic talks to the same BMC, old `authenticator` would be taken having updated session information inside\n\nThe way the BMC -\u003e session mapping should always be up-to-date.\n\nIs there a flaw in my thinking? ;-)","commit_id":"419061369087ccd5c1c3a147d91a4a8ba620074b"},{"author":{"_account_id":11076,"name":"Shivanand Tendulker","email":"stendulker@gmail.com","username":"stendulker"},"change_message_id":"081fb7abe200cd527c6a46388f21c041e4a0d3d8","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                )"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"                # This hopefully terminates BMC session"},{"line_number":240,"context_line":"                authenticator.close()"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"            except sushy.exceptions.ConnectionError as e:"},{"line_number":243,"context_line":"                LOG.warning(\u0027Failed to terminate Redfish session at \u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_5a8ff5d2","line":240,"range":{"start_line":240,"start_character":15,"end_line":240,"end_character":37},"updated":"2018-10-04 16:46:16.000000000","message":"This may cause the leak of a session if the cached session has already expired. The connector object re-creates the session-key if given one has expired. Isn\u0027t it?\nhttps://github.com/openstack/sushy/blob/e96cb4e7a4e919f43af5886c3d3caf0ec493a977/sushy/connector.py#L97-L104","commit_id":"419061369087ccd5c1c3a147d91a4a8ba620074b"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"205a48ba37ca3d7df2946debb68f2321dba01f64","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                )"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"                # This hopefully terminates BMC session"},{"line_number":240,"context_line":"                authenticator.close()"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"            except sushy.exceptions.ConnectionError as e:"},{"line_number":243,"context_line":"                LOG.warning(\u0027Failed to terminate Redfish session at \u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_41588155","line":240,"range":{"start_line":240,"start_character":15,"end_line":240,"end_character":37},"in_reply_to":"3f79a3b5_5a8ff5d2","updated":"2018-10-16 14:43:21.000000000","message":"I do not see how the leak could occur the way you\u0027ve described.\n\nFirst thing is that we cache `authenticator` objects, nor HTTP/requests/sushy connections.\n\nThe connector object does not re-create `authenticator` object, but updates its attributes.\n\nWhen we call `.close` here, the HTTP DELETE call is issued with existing `authenticator` over the newly created HTTP connection (this is done my sushy).\n\nWDYT?","commit_id":"419061369087ccd5c1c3a147d91a4a8ba620074b"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"424a70828603c5ea01f1ba63427d810ccedf5f67","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"class SessionCache(object):"},{"line_number":154,"context_line":"    \"\"\"Cache of HTTP sessions credentials\"\"\""},{"line_number":155,"context_line":"    MAX_SESSIONS \u003d 1000"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    sessions \u003d collections.OrderedDict()"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_0f6376e0","line":155,"updated":"2018-10-17 14:36:28.000000000","message":"thanks! We should likely put a note in that we might want to make this configurable in the future.","commit_id":"42e5916c7ca26f779baca41608d178dc8c7187c4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"bfe7d6371f8c6d84ca9e12a8f6e42527cb55d2ce","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            return sushy.Sushy("},{"line_number":172,"context_line":"                self._driver_info[\u0027address\u0027],"},{"line_number":173,"context_line":"                verify\u003dself._driver_info[\u0027verify_ca\u0027],"},{"line_number":174,"context_line":"                auth\u003dauthenticator"},{"line_number":175,"context_line":"            )"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        # NOTE(etingof): this code should work with older sushy"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_eff87ac2","line":174,"updated":"2018-10-17 14:44:25.000000000","message":"This is not supported on older sushy, is it?","commit_id":"42e5916c7ca26f779baca41608d178dc8c7187c4"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"560a4567b81409d0ead4f6ce240489c9bdd3aeb5","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            return sushy.Sushy("},{"line_number":172,"context_line":"                self._driver_info[\u0027address\u0027],"},{"line_number":173,"context_line":"                verify\u003dself._driver_info[\u0027verify_ca\u0027],"},{"line_number":174,"context_line":"                auth\u003dauthenticator"},{"line_number":175,"context_line":"            )"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        # NOTE(etingof): this code should work with older sushy"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_5fcb271c","line":174,"in_reply_to":"3f79a3b5_eff87ac2","updated":"2018-10-19 14:45:44.000000000","message":"Good point, I _think_ this is in a current release, but I\u0027ve not been tracking sushy as close as I should be. :(","commit_id":"42e5916c7ca26f779baca41608d178dc8c7187c4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"bfe7d6371f8c6d84ca9e12a8f6e42527cb55d2ce","unresolved":false,"context_lines":[{"line_number":175,"context_line":"            )"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        # NOTE(etingof): this code should work with older sushy"},{"line_number":178,"context_line":"        if hasattr(sushy.auth, \u0027SessionOrBasicAuth\u0027):"},{"line_number":179,"context_line":"            authenticator \u003d sushy.auth.SessionOrBasicAuth("},{"line_number":180,"context_line":"                username\u003dself._driver_info[\u0027username\u0027],"},{"line_number":181,"context_line":"                password\u003dself._driver_info[\u0027password\u0027]"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_8f278667","line":178,"updated":"2018-10-17 14:44:25.000000000","message":"Really, we should just cache connections...","commit_id":"42e5916c7ca26f779baca41608d178dc8c7187c4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"b92d4459431108440254137b787c6b738a2f689a","unresolved":false,"context_lines":[{"line_number":175,"context_line":"            )"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        # NOTE(etingof): this code should work with older sushy"},{"line_number":178,"context_line":"        if hasattr(sushy.auth, \u0027SessionOrBasicAuth\u0027):"},{"line_number":179,"context_line":"            authenticator \u003d sushy.auth.SessionOrBasicAuth("},{"line_number":180,"context_line":"                username\u003dself._driver_info[\u0027username\u0027],"},{"line_number":181,"context_line":"                password\u003dself._driver_info[\u0027password\u0027]"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_e25dba16","line":178,"in_reply_to":"3f79a3b5_8206461b","updated":"2018-10-19 14:58:52.000000000","message":"Won\u0027t requests reopen them?","commit_id":"42e5916c7ca26f779baca41608d178dc8c7187c4"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"560a4567b81409d0ead4f6ce240489c9bdd3aeb5","unresolved":false,"context_lines":[{"line_number":175,"context_line":"            )"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        # NOTE(etingof): this code should work with older sushy"},{"line_number":178,"context_line":"        if hasattr(sushy.auth, \u0027SessionOrBasicAuth\u0027):"},{"line_number":179,"context_line":"            authenticator \u003d sushy.auth.SessionOrBasicAuth("},{"line_number":180,"context_line":"                username\u003dself._driver_info[\u0027username\u0027],"},{"line_number":181,"context_line":"                password\u003dself._driver_info[\u0027password\u0027]"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_bfc4bb0e","line":178,"in_reply_to":"3f79a3b5_8f278667","updated":"2018-10-19 14:45:44.000000000","message":"I guess the question kind of then becomes how much memory are we going to use?","commit_id":"42e5916c7ca26f779baca41608d178dc8c7187c4"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"faffa9422746063c2dabac3a700b750b52e41557","unresolved":false,"context_lines":[{"line_number":175,"context_line":"            )"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        # NOTE(etingof): this code should work with older sushy"},{"line_number":178,"context_line":"        if hasattr(sushy.auth, \u0027SessionOrBasicAuth\u0027):"},{"line_number":179,"context_line":"            authenticator \u003d sushy.auth.SessionOrBasicAuth("},{"line_number":180,"context_line":"                username\u003dself._driver_info[\u0027username\u0027],"},{"line_number":181,"context_line":"                password\u003dself._driver_info[\u0027password\u0027]"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_8206461b","line":178,"in_reply_to":"3f79a3b5_bfc4bb0e","updated":"2018-10-19 14:54:48.000000000","message":"The other potential complication is that with `requests` we do not control the liveliness of the connections being cached. So that some may close down under the hood leaving us with a bunch of dead objects in cache...","commit_id":"42e5916c7ca26f779baca41608d178dc8c7187c4"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"7a31a53a626134a3cd116899530a2eccec216081","unresolved":false,"context_lines":[{"line_number":175,"context_line":"            )"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"        # NOTE(etingof): this code should work with older sushy"},{"line_number":178,"context_line":"        if hasattr(sushy.auth, \u0027SessionOrBasicAuth\u0027):"},{"line_number":179,"context_line":"            authenticator \u003d sushy.auth.SessionOrBasicAuth("},{"line_number":180,"context_line":"                username\u003dself._driver_info[\u0027username\u0027],"},{"line_number":181,"context_line":"                password\u003dself._driver_info[\u0027password\u0027]"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_221c1213","line":178,"in_reply_to":"3f79a3b5_e25dba16","updated":"2018-10-19 15:20:43.000000000","message":"Most certainly it will!\n\nTrouble is that we are risking to cache the dead stuff which seems suboptimal especially if we are aiming at caching 1K connections. If the underlying TCP connection closes down, the only useful piece of information left in the cache (in our use-case) would be the authenticator object -- this is precisely what we are trying to cache now.","commit_id":"42e5916c7ca26f779baca41608d178dc8c7187c4"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"424a70828603c5ea01f1ba63427d810ccedf5f67","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                )"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"                # This hopefully terminates BMC session"},{"line_number":247,"context_line":"                authenticator.close()"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"            except sushy.exceptions.ConnectionError as e:"},{"line_number":250,"context_line":"                LOG.warning(\u0027Failed to terminate Redfish session at \u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_2f8e727a","line":247,"updated":"2018-10-17 14:36:28.000000000","message":"Might be good to maybe stage a test of this against some hardware out there. :\\","commit_id":"42e5916c7ca26f779baca41608d178dc8c7187c4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"5ab12f1e39dff57816ef033cbb17d9288489e53e","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"class SessionCache(object):"},{"line_number":154,"context_line":"    \"\"\"Cache of HTTP sessions credentials\"\"\""},{"line_number":155,"context_line":"    MAX_SESSIONS \u003d 1000"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    sessions \u003d collections.OrderedDict()"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_e654ce25","line":155,"updated":"2018-11-03 13:07:21.000000000","message":"nit: make configurable?","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"5720fb176ea7faf7e2e8f081931ba16c0c3edd9b","unresolved":false,"context_lines":[{"line_number":152,"context_line":""},{"line_number":153,"context_line":"class SessionCache(object):"},{"line_number":154,"context_line":"    \"\"\"Cache of HTTP sessions credentials\"\"\""},{"line_number":155,"context_line":"    MAX_SESSIONS \u003d 1000"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    sessions \u003d collections.OrderedDict()"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_bba52b03","line":155,"in_reply_to":"3f79a3b5_e654ce25","updated":"2018-11-08 16:43:03.000000000","message":"Done. Not sure if this new option justifies a release note?","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"5ab12f1e39dff57816ef033cbb17d9288489e53e","unresolved":false,"context_lines":[{"line_number":154,"context_line":"    \"\"\"Cache of HTTP sessions credentials\"\"\""},{"line_number":155,"context_line":"    MAX_SESSIONS \u003d 1000"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    sessions \u003d collections.OrderedDict()"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def __init__(self, driver_info):"},{"line_number":160,"context_line":"        self._driver_info \u003d driver_info"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_86539a3a","line":157,"updated":"2018-11-03 13:07:21.000000000","message":"nit: _sessions","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"5720fb176ea7faf7e2e8f081931ba16c0c3edd9b","unresolved":false,"context_lines":[{"line_number":154,"context_line":"    \"\"\"Cache of HTTP sessions credentials\"\"\""},{"line_number":155,"context_line":"    MAX_SESSIONS \u003d 1000"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    sessions \u003d collections.OrderedDict()"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def __init__(self, driver_info):"},{"line_number":160,"context_line":"        self._driver_info \u003d driver_info"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_7bab13d3","line":157,"in_reply_to":"3f79a3b5_86539a3a","updated":"2018-11-08 16:43:03.000000000","message":"Done","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"496178598133541f629b4db06da09e1027c5d346","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        self._driver_info \u003d driver_info"},{"line_number":161,"context_line":"        self._session_key \u003d tuple("},{"line_number":162,"context_line":"            self._driver_info.get(key)"},{"line_number":163,"context_line":"            for key in (\u0027address\u0027, \u0027username\u0027, \u0027verify_ca\u0027)"},{"line_number":164,"context_line":"        )"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def __enter__(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_d5a23d98","line":163,"range":{"start_line":163,"start_character":12,"end_line":163,"end_character":59},"updated":"2018-11-08 08:03:45.000000000","message":"don\u0027t we also need to add the node-uuid as part of the unique key?","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"5720fb176ea7faf7e2e8f081931ba16c0c3edd9b","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        self._driver_info \u003d driver_info"},{"line_number":161,"context_line":"        self._session_key \u003d tuple("},{"line_number":162,"context_line":"            self._driver_info.get(key)"},{"line_number":163,"context_line":"            for key in (\u0027address\u0027, \u0027username\u0027, \u0027verify_ca\u0027)"},{"line_number":164,"context_line":"        )"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def __enter__(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_7b847357","line":163,"range":{"start_line":163,"start_character":12,"end_line":163,"end_character":59},"in_reply_to":"3f79a3b5_d5a23d98","updated":"2018-11-08 16:43:03.000000000","message":"I am not sure... My understanding is that a single Redfish BMC can manage many nodes using the same session credentials. If we add node-uuid here, we would not be reusing session for distinct nodes behind a single BMC.\n\nWDYT?","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"5ab12f1e39dff57816ef033cbb17d9288489e53e","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def __enter__(self):"},{"line_number":167,"context_line":"        try:"},{"line_number":168,"context_line":"            return self.sessions[self._session_key]"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        except KeyError:"},{"line_number":171,"context_line":"            conn \u003d sushy.Sushy("}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_a64ed68d","line":168,"updated":"2018-11-03 13:07:21.000000000","message":"nit: self.__class__.session (to make the intention more obvious)","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"5720fb176ea7faf7e2e8f081931ba16c0c3edd9b","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def __enter__(self):"},{"line_number":167,"context_line":"        try:"},{"line_number":168,"context_line":"            return self.sessions[self._session_key]"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        except KeyError:"},{"line_number":171,"context_line":"            conn \u003d sushy.Sushy("}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_7bd9d37e","line":168,"in_reply_to":"3f79a3b5_a64ed68d","updated":"2018-11-08 16:43:03.000000000","message":"Done","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"496178598133541f629b4db06da09e1027c5d346","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            return self.sessions[self._session_key]"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        except KeyError:"},{"line_number":171,"context_line":"            conn \u003d sushy.Sushy("},{"line_number":172,"context_line":"                self._driver_info[\u0027address\u0027],"},{"line_number":173,"context_line":"                username\u003dself._driver_info[\u0027username\u0027],"},{"line_number":174,"context_line":"                password\u003dself._driver_info[\u0027password\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_9573651c","line":171,"range":{"start_line":171,"start_character":12,"end_line":171,"end_character":31},"updated":"2018-11-08 08:03:45.000000000","message":"As I am late to the discussion, possibly I am missing the points already discussed. I am just trying to question the caching of Sushy instances rather than Sushy Auth instances.","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"5720fb176ea7faf7e2e8f081931ba16c0c3edd9b","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            return self.sessions[self._session_key]"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        except KeyError:"},{"line_number":171,"context_line":"            conn \u003d sushy.Sushy("},{"line_number":172,"context_line":"                self._driver_info[\u0027address\u0027],"},{"line_number":173,"context_line":"                username\u003dself._driver_info[\u0027username\u0027],"},{"line_number":174,"context_line":"                password\u003dself._driver_info[\u0027password\u0027],"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_734017a4","line":171,"range":{"start_line":171,"start_character":12,"end_line":171,"end_character":31},"in_reply_to":"3f79a3b5_9573651c","updated":"2018-11-08 16:43:03.000000000","message":"That is the very good question, Deb!\n\nOne of the versions of this patch actually dealt with the auth objects. Trouble is that the way sushy is designed does not promote authenticator object use. You could find all sorts of wild hacks I had to resort to put it all together.\n\nSo the proper solution might be to 1) refactor sushy connection/authenticator/sushy significantly and then 2) revisit this place in ironic to cache just authenticator.\n\nYou could also find some concerns wrt urllib connection pooling interplay with ironic cache. That makes minimalistic authenticator caching looking safer to me.","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":16635,"name":"deray","email":"debayan.ray@gmail.com","username":"deray"},"change_message_id":"496178598133541f629b4db06da09e1027c5d346","unresolved":false,"context_lines":[{"line_number":175,"context_line":"                verify\u003dself._driver_info[\u0027verify_ca\u0027]"},{"line_number":176,"context_line":"            )"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"            self._expire_oldest_session()"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"            self.sessions[self._session_key] \u003d conn"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_75fb2979","line":178,"range":{"start_line":178,"start_character":12,"end_line":178,"end_character":41},"updated":"2018-11-08 08:03:45.000000000","message":"nit: we can rather create a small utility like ``lru_cache`` [1] and use that here. The one available is only for Python3 and hence if created can be of immense use for the entire code base in Ironic!\n\n[1] https://docs.python.org/3/library/functools.html#functools.lru_cache","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"5720fb176ea7faf7e2e8f081931ba16c0c3edd9b","unresolved":false,"context_lines":[{"line_number":175,"context_line":"                verify\u003dself._driver_info[\u0027verify_ca\u0027]"},{"line_number":176,"context_line":"            )"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"            self._expire_oldest_session()"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"            self.sessions[self._session_key] \u003d conn"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_b368ef21","line":178,"range":{"start_line":178,"start_character":12,"end_line":178,"end_character":41},"in_reply_to":"3f79a3b5_75fb2979","updated":"2018-11-08 16:43:03.000000000","message":"I am not sure it would be well reusable because of the specifics of the underlying data structure and/or specific expiration requirements... Here, for example, we reply on ordered dict.\n\nWDYT?\n\nAnyway, I\u0027d address this separately to keep this patch smaller.","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"5ab12f1e39dff57816ef033cbb17d9288489e53e","unresolved":false,"context_lines":[{"line_number":177,"context_line":""},{"line_number":178,"context_line":"            self._expire_oldest_session()"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"            self.sessions[self._session_key] \u003d conn"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"            return conn"},{"line_number":183,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_462b429a","line":180,"updated":"2018-11-03 13:07:21.000000000","message":"ditto","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"5720fb176ea7faf7e2e8f081931ba16c0c3edd9b","unresolved":false,"context_lines":[{"line_number":177,"context_line":""},{"line_number":178,"context_line":"            self._expire_oldest_session()"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"            self.sessions[self._session_key] \u003d conn"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"            return conn"},{"line_number":183,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_736ed72d","line":180,"in_reply_to":"3f79a3b5_462b429a","updated":"2018-11-08 16:43:03.000000000","message":"Done","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"5ab12f1e39dff57816ef033cbb17d9288489e53e","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        if isinstance(exc_val, sushy.exceptions.ConnectionError):"},{"line_number":187,"context_line":"            self.sessions.pop(self._session_key, None)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def _expire_oldest_session(self):"},{"line_number":190,"context_line":"        \"\"\"Expire oldest session\"\"\""},{"line_number":191,"context_line":"        if len(self.sessions) \u003e\u003d self.MAX_SESSIONS:"},{"line_number":192,"context_line":"            session_keys \u003d list(self.sessions)"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_662e7eab","line":189,"updated":"2018-11-03 13:07:21.000000000","message":"nit: convert to a classmethod","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"5720fb176ea7faf7e2e8f081931ba16c0c3edd9b","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        if isinstance(exc_val, sushy.exceptions.ConnectionError):"},{"line_number":187,"context_line":"            self.sessions.pop(self._session_key, None)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def _expire_oldest_session(self):"},{"line_number":190,"context_line":"        \"\"\"Expire oldest session\"\"\""},{"line_number":191,"context_line":"        if len(self.sessions) \u003e\u003d self.MAX_SESSIONS:"},{"line_number":192,"context_line":"            session_keys \u003d list(self.sessions)"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_53615b37","line":189,"in_reply_to":"3f79a3b5_662e7eab","updated":"2018-11-08 16:43:03.000000000","message":"Done","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"5ab12f1e39dff57816ef033cbb17d9288489e53e","unresolved":false,"context_lines":[{"line_number":190,"context_line":"        \"\"\"Expire oldest session\"\"\""},{"line_number":191,"context_line":"        if len(self.sessions) \u003e\u003d self.MAX_SESSIONS:"},{"line_number":192,"context_line":"            session_keys \u003d list(self.sessions)"},{"line_number":193,"context_line":"            session_key \u003d session_keys[0]"},{"line_number":194,"context_line":"            # NOTE(etingof): GC should cause sushy to HTTP DELETE session"},{"line_number":195,"context_line":"            # at BMC. Trouble is that as of this commit sushy does not do that."},{"line_number":196,"context_line":"            self.sessions.pop(session_key, None)"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_06354af6","line":193,"updated":"2018-11-03 13:07:21.000000000","message":"It is probably more efficient to do something like next(iter(self.sessions)) since it won\u0027t require to construct the whole list.","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"5720fb176ea7faf7e2e8f081931ba16c0c3edd9b","unresolved":false,"context_lines":[{"line_number":190,"context_line":"        \"\"\"Expire oldest session\"\"\""},{"line_number":191,"context_line":"        if len(self.sessions) \u003e\u003d self.MAX_SESSIONS:"},{"line_number":192,"context_line":"            session_keys \u003d list(self.sessions)"},{"line_number":193,"context_line":"            session_key \u003d session_keys[0]"},{"line_number":194,"context_line":"            # NOTE(etingof): GC should cause sushy to HTTP DELETE session"},{"line_number":195,"context_line":"            # at BMC. Trouble is that as of this commit sushy does not do that."},{"line_number":196,"context_line":"            self.sessions.pop(session_key, None)"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_b3d6afc3","line":193,"in_reply_to":"3f79a3b5_06354af6","updated":"2018-11-08 16:43:03.000000000","message":"Done","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"ecbb51af7c1bb2fb9b15182d9e55333627253bba","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        if len(self.sessions) \u003e\u003d self.MAX_SESSIONS:"},{"line_number":192,"context_line":"            session_keys \u003d list(self.sessions)"},{"line_number":193,"context_line":"            session_key \u003d session_keys[0]"},{"line_number":194,"context_line":"            # NOTE(etingof): GC should cause sushy to HTTP DELETE session"},{"line_number":195,"context_line":"            # at BMC. Trouble is that as of this commit sushy does not do that."},{"line_number":196,"context_line":"            self.sessions.pop(session_key, None)"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_822ab42b","line":194,"range":{"start_line":194,"start_character":13,"end_line":194,"end_character":73},"updated":"2018-11-02 16:36:33.000000000","message":"Is this for a specific version?","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"5720fb176ea7faf7e2e8f081931ba16c0c3edd9b","unresolved":false,"context_lines":[{"line_number":191,"context_line":"        if len(self.sessions) \u003e\u003d self.MAX_SESSIONS:"},{"line_number":192,"context_line":"            session_keys \u003d list(self.sessions)"},{"line_number":193,"context_line":"            session_key \u003d session_keys[0]"},{"line_number":194,"context_line":"            # NOTE(etingof): GC should cause sushy to HTTP DELETE session"},{"line_number":195,"context_line":"            # at BMC. Trouble is that as of this commit sushy does not do that."},{"line_number":196,"context_line":"            self.sessions.pop(session_key, None)"},{"line_number":197,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_7351f730","line":194,"range":{"start_line":194,"start_character":13,"end_line":194,"end_character":73},"in_reply_to":"3f79a3b5_822ab42b","updated":"2018-11-08 16:43:03.000000000","message":"Done","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"5ab12f1e39dff57816ef033cbb17d9288489e53e","unresolved":false,"context_lines":[{"line_number":192,"context_line":"            session_keys \u003d list(self.sessions)"},{"line_number":193,"context_line":"            session_key \u003d session_keys[0]"},{"line_number":194,"context_line":"            # NOTE(etingof): GC should cause sushy to HTTP DELETE session"},{"line_number":195,"context_line":"            # at BMC. Trouble is that as of this commit sushy does not do that."},{"line_number":196,"context_line":"            self.sessions.pop(session_key, None)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_263886eb","line":195,"updated":"2018-11-03 13:07:21.000000000","message":"\"This commit\" is quite confusing when talking about a different repository.","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"5720fb176ea7faf7e2e8f081931ba16c0c3edd9b","unresolved":false,"context_lines":[{"line_number":192,"context_line":"            session_keys \u003d list(self.sessions)"},{"line_number":193,"context_line":"            session_key \u003d session_keys[0]"},{"line_number":194,"context_line":"            # NOTE(etingof): GC should cause sushy to HTTP DELETE session"},{"line_number":195,"context_line":"            # at BMC. Trouble is that as of this commit sushy does not do that."},{"line_number":196,"context_line":"            self.sessions.pop(session_key, None)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_53307b06","line":195,"in_reply_to":"3f79a3b5_263886eb","updated":"2018-11-08 16:43:03.000000000","message":"Referred to specific sushy version (1.6.0)","commit_id":"8a64d03dc0c9dc6671898c9287e3d6b1f2873ecc"}],"releasenotes/notes/persist-redfish-sessions-d521a0846fa45c40.yaml":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e090c55b8d40a0eda03b9ae148dc8701a4a6e4ee","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Fixes Redfish client to reuse HTTP session tokens when talking to BMC"},{"line_number":5,"context_line":"    using session authentication. Prior to this fix Redfish client never"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"3f79a3b5_d79dd36c","line":2,"updated":"2018-09-26 13:38:38.000000000","message":"Since this is a bug fix, let us swap it with the parent patch. Otherwise we\u0027ll have hard time backporting it.","commit_id":"a6aa02a0266385da029331d0697332e9f16a6b7b"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"e090c55b8d40a0eda03b9ae148dc8701a4a6e4ee","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Fixes Redfish client to reuse HTTP session tokens when talking to BMC"},{"line_number":5,"context_line":"    using session authentication. Prior to this fix Redfish client never"},{"line_number":6,"context_line":"    tried to reuse session token given out by BMC during previous connection"},{"line_number":7,"context_line":"    what may sometimes lead to session pool exhaustion with some BMC"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"3f79a3b5_f7a00fa7","line":4,"updated":"2018-09-26 13:38:38.000000000","message":"nit: s/Redfish client/the ``redfish`` hardware type/ ?","commit_id":"a6aa02a0266385da029331d0697332e9f16a6b7b"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"e770cb961f06492083dfa306a397433af77ef976","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Fixes Redfish client to reuse HTTP session tokens when talking to BMC"},{"line_number":5,"context_line":"    using session authentication. Prior to this fix Redfish client never"},{"line_number":6,"context_line":"    tried to reuse session token given out by BMC during previous connection"},{"line_number":7,"context_line":"    what may sometimes lead to session pool exhaustion with some BMC"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"3f79a3b5_0d9b3e73","line":4,"in_reply_to":"3f79a3b5_f7a00fa7","updated":"2018-09-27 06:02:39.000000000","message":"Done","commit_id":"a6aa02a0266385da029331d0697332e9f16a6b7b"}]}
