)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"2a4fc0a06e378637a3bdcd20a83eb8920f6cd0b1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"5fc1f717_22a8d48a","updated":"2019-03-29 17:57:01.000000000","message":"Nicely explained.","commit_id":"e4fa061f17353f49615d4850b562699d55a0641b"}],"nova/console/websocketproxy.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c2cb51d0c791b70b367627b1d0459058e8923315","unresolved":false,"context_lines":[{"line_number":316,"context_line":"        # then. handle_websocket() is called before new_websocket_client()."},{"line_number":317,"context_line":"        # We do this here instead of in __init__() because in the event that"},{"line_number":318,"context_line":"        # we receive a TCP RST, we do not want to create a ComputeAPI object,"},{"line_number":319,"context_line":"        # and handle_websocket() is not called in the event of a TCP RST."},{"line_number":320,"context_line":"        self.compute_rpcapi \u003d compute_rpcapi.ComputeAPI()"},{"line_number":321,"context_line":"        return websockify.ProxyRequestHandler.handle_websocket(self)"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_3258612f","line":319,"range":{"start_line":319,"start_character":72,"end_line":319,"end_character":73},"updated":"2019-03-27 09:51:33.000000000","message":"This seems a bit brittle, relying on the call order internals of ProxyRequestHandler. Would a lazy load of ComputeAPI (from __init__) have the desired effect?","commit_id":"4be0187ebc80eeaf6c9935ec76078a8d335b3add"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"8b6537bf0f9e08f87035f51cf6c595f95e309f72","unresolved":false,"context_lines":[{"line_number":316,"context_line":"        # then. handle_websocket() is called before new_websocket_client()."},{"line_number":317,"context_line":"        # We do this here instead of in __init__() because in the event that"},{"line_number":318,"context_line":"        # we receive a TCP RST, we do not want to create a ComputeAPI object,"},{"line_number":319,"context_line":"        # and handle_websocket() is not called in the event of a TCP RST."},{"line_number":320,"context_line":"        self.compute_rpcapi \u003d compute_rpcapi.ComputeAPI()"},{"line_number":321,"context_line":"        return websockify.ProxyRequestHandler.handle_websocket(self)"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_5d7f3514","line":319,"range":{"start_line":319,"start_character":72,"end_line":319,"end_character":73},"in_reply_to":"5fc1f717_3258612f","updated":"2019-03-27 17:07:17.000000000","message":"Hm, yeah, I think it would help to lazy load ComputeAPI from __init__, but we would have to make the instance global to the module in that case (__init__ is called for every new connection). That means if more than one proxy is on a single host (example: vnc proxy and spice proxy), they would share the same ComputeAPI instance. I\u0027m not sure if that could be a problem. I\u0027ll ask.","commit_id":"4be0187ebc80eeaf6c9935ec76078a8d335b3add"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"e560efb1431721c764aa5cdebc98d28a3727d48e","unresolved":false,"context_lines":[{"line_number":316,"context_line":"        # then. handle_websocket() is called before new_websocket_client()."},{"line_number":317,"context_line":"        # We do this here instead of in __init__() because in the event that"},{"line_number":318,"context_line":"        # we receive a TCP RST, we do not want to create a ComputeAPI object,"},{"line_number":319,"context_line":"        # and handle_websocket() is not called in the event of a TCP RST."},{"line_number":320,"context_line":"        self.compute_rpcapi \u003d compute_rpcapi.ComputeAPI()"},{"line_number":321,"context_line":"        return websockify.ProxyRequestHandler.handle_websocket(self)"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_6c14c0e9","line":319,"range":{"start_line":319,"start_character":72,"end_line":319,"end_character":73},"in_reply_to":"5fc1f717_5d7f3514","updated":"2019-03-27 18:07:38.000000000","message":"OK, I asked dansmith about this in IRC [1] and he pointed out that if rpcapi/ComputeAPI were to be made global, we would need to handle reloading it (and thus recalculating what compute rpcapi version it should send) upon a SIGHUP [2]. But this proxy doesn\u0027t run through oslo.service like the other services do -- it\u0027s a websockify server. And I found that websockify server ignores SIGHUP [3].\n\nSo it seems like relying on the websockify call ordering is less bad than not being able to have rpcapi/ComputeAPI recalculate versions while the server is running.\n\n[1] http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2019-03-27.log.html#t2019-03-27T17:16:40\n[2] https://github.com/openstack/nova/blob/38ce9d8/nova/compute/manager.py#L548\n[3] https://github.com/novnc/websockify/blob/38b7771/other/websocket.c#L768","commit_id":"4be0187ebc80eeaf6c9935ec76078a8d335b3add"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"fcc49709bf4c9073b60c5af98ee399ef4c2669d2","unresolved":false,"context_lines":[{"line_number":316,"context_line":"        # then. handle_websocket() is called before new_websocket_client()."},{"line_number":317,"context_line":"        # We do this here instead of in __init__() because in the event that"},{"line_number":318,"context_line":"        # we receive a TCP RST, we do not want to create a ComputeAPI object,"},{"line_number":319,"context_line":"        # and handle_websocket() is not called in the event of a TCP RST."},{"line_number":320,"context_line":"        self.compute_rpcapi \u003d compute_rpcapi.ComputeAPI()"},{"line_number":321,"context_line":"        return websockify.ProxyRequestHandler.handle_websocket(self)"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_c506e71c","line":319,"range":{"start_line":319,"start_character":72,"end_line":319,"end_character":73},"in_reply_to":"5fc1f717_6c14c0e9","updated":"2019-03-27 20:35:15.000000000","message":"Update: what efried meant by lazy load is lazy load ComputeAPI on first use (which would be in new_websocket_client). I had thought from the pre-existing code comment, that ComputeAPI needed to be constructed _before_ new_websocket_client was called, but that\u0027s probably not the case. It probably just meant that ComputeAPI is needed by the time it\u0027s used by new_websocket_client.\n\nSo, I\u0027m going to try lazy constructing it in new_websocket_client before it\u0027s used.","commit_id":"4be0187ebc80eeaf6c9935ec76078a8d335b3add"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"906358b27b9da7facfd7275fa5804b01b11d523d","unresolved":false,"context_lines":[{"line_number":316,"context_line":"        # then. handle_websocket() is called before new_websocket_client()."},{"line_number":317,"context_line":"        # We do this here instead of in __init__() because in the event that"},{"line_number":318,"context_line":"        # we receive a TCP RST, we do not want to create a ComputeAPI object,"},{"line_number":319,"context_line":"        # and handle_websocket() is not called in the event of a TCP RST."},{"line_number":320,"context_line":"        self.compute_rpcapi \u003d compute_rpcapi.ComputeAPI()"},{"line_number":321,"context_line":"        return websockify.ProxyRequestHandler.handle_websocket(self)"},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_8561bf07","line":319,"range":{"start_line":319,"start_character":72,"end_line":319,"end_character":73},"in_reply_to":"5fc1f717_c506e71c","updated":"2019-03-27 21:13:15.000000000","message":"...lazy constructing it in __init__ so that new_websocket_client (or whatever happens to touch it first, now or in the future) triggers instantiating the real thing whenever it first touches it.","commit_id":"4be0187ebc80eeaf6c9935ec76078a8d335b3add"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ac0f6a4ace391eaaa271c4887aa643d8a7b48401","unresolved":false,"context_lines":[{"line_number":314,"context_line":"        # object we won\u0027t use."},{"line_number":315,"context_line":"        if not self._compute_rpcapi:"},{"line_number":316,"context_line":"            self._compute_rpcapi \u003d compute_rpcapi.ComputeAPI()"},{"line_number":317,"context_line":"        return self._compute_rpcapi"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"    def socket(self, *args, **kwargs):"},{"line_number":320,"context_line":"        return websockify.WebSocketServer.socket(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5fc1f717_e014314f","line":317,"updated":"2019-03-27 22:03:30.000000000","message":"oh, that\u0027s way nicer than the LazyLoader I would have hacked together.","commit_id":"e4fa061f17353f49615d4850b562699d55a0641b"}]}
