)]}'
{"nova/context.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"80bc048edc2779661f15aaa461f6a89639e54ef7","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":40,"context_line":"# TODO(melwitt): This cache should also be cleared periodically based on an"},{"line_number":41,"context_line":"# expiration time."},{"line_number":42,"context_line":"CELL_CACHE \u003d {}"},{"line_number":43,"context_line":"# NOTE(melwitt): Used for the scatter-gather utility to indicate we timed out"},{"line_number":44,"context_line":"# waiting for a result from a cell."}],"source_content_type":"text/x-python","patch_set":2,"id":"df33271e_e64b4a84","line":41,"updated":"2020-04-08 15:47:41.000000000","message":"I wouldn\u0027t really argue with this, although I\u0027m not sure I\u0027m sold. For 98% of cases where there\u0027s only ever one cell, expiring this ever is just making more work for ourselves. Even in cases where there are multiples, it\u0027d be problematic if the timer is long (as it should be) and unsynchronized. For example, scheduler expires its list, starts sending things to cells that conductor doesn\u0027t know about yet.","commit_id":"bac114564665aadd89b7ebcbdc3c6ce9d452aa98"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"de566c27749d9f5fdc2aee53d0b6cd9ccf1146ba","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":40,"context_line":"# TODO(melwitt): This cache should also be cleared periodically based on an"},{"line_number":41,"context_line":"# expiration time."},{"line_number":42,"context_line":"CELL_CACHE \u003d {}"},{"line_number":43,"context_line":"# NOTE(melwitt): Used for the scatter-gather utility to indicate we timed out"},{"line_number":44,"context_line":"# waiting for a result from a cell."}],"source_content_type":"text/x-python","patch_set":2,"id":"df33271e_9d9e0961","line":41,"in_reply_to":"df33271e_e64b4a84","updated":"2020-04-08 16:02:59.000000000","message":"That\u0027s fair enough -- I haven\u0027t felt strongly about refreshing on a timer and I defaulted to keeping the comment here. I was really just taking the lead from L47.","commit_id":"bac114564665aadd89b7ebcbdc3c6ce9d452aa98"}],"nova/service.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6bdee3368da013d5f9c82e174c72813deff77f34","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        # inherits a locked oslo.db lock, database accesses through that"},{"line_number":157,"context_line":"        # transaction context manager will never be able to acquire the lock"},{"line_number":158,"context_line":"        # and requests will fail with CellTimeout errors."},{"line_number":159,"context_line":"        # See https://bugs.python.org/issue40089 for more details."},{"line_number":160,"context_line":"        context.CELL_CACHE \u003d {}"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        assert_eventlet_uses_monotonic_clock()"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_d77c40ed","line":159,"updated":"2020-04-06 07:33:24.000000000","message":"Hm, maybe I should have linked https://bugs.launchpad.net/nova/+bug/1844929 here instead. And maybe should also mention that this could be removed once (1) python issue 40089 is resolved and (2) we require \u003e\u003d the python version it\u0027s fixed in.","commit_id":"76b151fe004f3114cc90f29e70c53ae5e127ae8d"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"2cd17218b6b13e80a5430af5cd25c37c837de103","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        # inherits a locked oslo.db lock, database accesses through that"},{"line_number":157,"context_line":"        # transaction context manager will never be able to acquire the lock"},{"line_number":158,"context_line":"        # and requests will fail with CellTimeout errors."},{"line_number":159,"context_line":"        # See https://bugs.python.org/issue40089 for more details."},{"line_number":160,"context_line":"        context.CELL_CACHE \u003d {}"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        assert_eventlet_uses_monotonic_clock()"}],"source_content_type":"text/x-python","patch_set":1,"id":"df33271e_d8ac358e","line":159,"in_reply_to":"df33271e_d77c40ed","updated":"2020-04-08 03:09:57.000000000","message":"This isn\u0027t quite right based on what I learned at:\n\nhttps://bugs.python.org/issue40091#msg365959\n\nSanitizing locks automatically is not something that python can ever do. It has to be taken care of by each library or application.\n\nI\u0027m going to update this comment.","commit_id":"76b151fe004f3114cc90f29e70c53ae5e127ae8d"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"80bc048edc2779661f15aaa461f6a89639e54ef7","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        # os.register_at_fork() method to reinitialize its lock. Until we"},{"line_number":162,"context_line":"        # require python 3.7 as a mininum version, we must handle the situation"},{"line_number":163,"context_line":"        # outside of oslo.db."},{"line_number":164,"context_line":"        context.CELL_CACHE \u003d {}"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        assert_eventlet_uses_monotonic_clock()"},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df33271e_a62e62a2","line":164,"updated":"2020-04-08 15:47:41.000000000","message":"Just to be clear, this is late enough that it gets run after fork? I haven\u0027t gone chasing, but maybe you could just link in the review here for completeness?","commit_id":"bac114564665aadd89b7ebcbdc3c6ce9d452aa98"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"126b447e40ca025943c4ba6140b5cbc365bc711c","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        # os.register_at_fork() method to reinitialize its lock. Until we"},{"line_number":162,"context_line":"        # require python 3.7 as a mininum version, we must handle the situation"},{"line_number":163,"context_line":"        # outside of oslo.db."},{"line_number":164,"context_line":"        context.CELL_CACHE \u003d {}"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        assert_eventlet_uses_monotonic_clock()"},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df33271e_4c12105a","line":164,"in_reply_to":"df33271e_7dfd05b0","updated":"2020-04-08 16:51:24.000000000","message":"Ack, thanks, makes sense.","commit_id":"bac114564665aadd89b7ebcbdc3c6ce9d452aa98"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"de566c27749d9f5fdc2aee53d0b6cd9ccf1146ba","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        # os.register_at_fork() method to reinitialize its lock. Until we"},{"line_number":162,"context_line":"        # require python 3.7 as a mininum version, we must handle the situation"},{"line_number":163,"context_line":"        # outside of oslo.db."},{"line_number":164,"context_line":"        context.CELL_CACHE \u003d {}"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        assert_eventlet_uses_monotonic_clock()"},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df33271e_7dfd05b0","line":164,"in_reply_to":"df33271e_a62e62a2","updated":"2020-04-08 16:02:59.000000000","message":"Yeah, it\u0027s a little bit to unravel.\n\nFork happens here:\n\nhttps://github.com/openstack/oslo.service/blob/b7dc0d72c92215755692b2d96b799453dc7d0c00/oslo_service/service.py#L551-L565\n\nwhich calls _child_process:\n\nhttps://github.com/openstack/oslo.service/blob/b7dc0d72c92215755692b2d96b799453dc7d0c00/oslo_service/service.py#L532-L548\n\nwhich creates a plain Launcher, then calls Launcher.launch_service:\n\nhttps://github.com/openstack/oslo.service/blob/b7dc0d72c92215755692b2d96b799453dc7d0c00/oslo_service/service.py#L269-L284\n\nwhich calls Services.add:\n\nhttps://github.com/openstack/oslo.service/blob/b7dc0d72c92215755692b2d96b799453dc7d0c00/oslo_service/service.py#L744-L760\n\nwhich calls Services.run_service:\n\nhttps://github.com/openstack/oslo.service/blob/b7dc0d72c92215755692b2d96b799453dc7d0c00/oslo_service/service.py#L801-L810\n\nwhich calls start().","commit_id":"bac114564665aadd89b7ebcbdc3c6ce9d452aa98"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"126b447e40ca025943c4ba6140b5cbc365bc711c","unresolved":false,"context_lines":[{"line_number":322,"context_line":"        context.CELL_CACHE \u003d {}"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"class WSGIService(service.Service):"},{"line_number":326,"context_line":"    \"\"\"Provides ability to launch API from a \u0027paste\u0027 configuration.\"\"\""},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def __init__(self, name, loader\u003dNone, use_ssl\u003dFalse, max_url_len\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"df33271e_0c09282b","line":325,"updated":"2020-04-08 16:51:24.000000000","message":"Do we not want to clear the cache on startup for these? WSGIService is the one that forks a lot over the lifetime of the service, so I would think it\u0027s more likely to hit the problem, no?","commit_id":"bac114564665aadd89b7ebcbdc3c6ce9d452aa98"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f85068b84e8b44a84b50158a38764205ba678ded","unresolved":false,"context_lines":[{"line_number":322,"context_line":"        context.CELL_CACHE \u003d {}"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"class WSGIService(service.Service):"},{"line_number":326,"context_line":"    \"\"\"Provides ability to launch API from a \u0027paste\u0027 configuration.\"\"\""},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def __init__(self, name, loader\u003dNone, use_ssl\u003dFalse, max_url_len\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"df33271e_cc890027","line":325,"in_reply_to":"df33271e_0c09282b","updated":"2020-04-08 17:03:11.000000000","message":"Gah, we do. I got it for reset() and then through code inspection realized that reset() is not called during fork, so then I went back and added to start() and missed it here. Thanks for the catch.","commit_id":"bac114564665aadd89b7ebcbdc3c6ce9d452aa98"}],"nova/tests/functional/test_service.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0d586ca12f29e438b848d78b2cfecf9fa200cb17","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        # Cell cache should be empty after the service start."},{"line_number":90,"context_line":"        self.assertEqual({}, nova_context.CELL_CACHE)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        # Now test the WSGI service."},{"line_number":93,"context_line":"        server \u003d self.api.post_server({\u0027server\u0027: server_req})"},{"line_number":94,"context_line":"        self._wait_for_state_change(server, \u0027ACTIVE\u0027)"},{"line_number":95,"context_line":"        # Cell cache should be populated after creating a server."},{"line_number":96,"context_line":"        self.assertTrue(nova_context.CELL_CACHE)"},{"line_number":97,"context_line":"        self.metadata.stop()"},{"line_number":98,"context_line":"        self.metadata.start()"},{"line_number":99,"context_line":"        # Cell cache should be empty after the service reset."},{"line_number":100,"context_line":"        self.assertEqual({}, nova_context.CELL_CACHE)"}],"source_content_type":"text/x-python","patch_set":3,"id":"df33271e_f7c808a9","line":100,"range":{"start_line":92,"start_character":8,"end_line":100,"end_character":53},"updated":"2020-04-08 20:12:36.000000000","message":"I think I would probably test these separately, especially since they\u0027re wholly unrelated within nova. But I shan\u0027t nit out over that for the fix.","commit_id":"941559042f609ee43ff3160c0f0d0c45187be17f"}]}
