)]}'
{"nodepool/driver/utils.py":[{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"75dad34f87707cfaf2de53617ea2c27fcba9265d","unresolved":true,"context_lines":[{"line_number":507,"context_line":"                    finally:"},{"line_number":508,"context_line":"                        # Clear the future regardless so we don\u0027t loop."},{"line_number":509,"context_line":"                        self.future \u003d None"},{"line_number":510,"context_line":"                if (self.last_time is not None and"},{"line_number":511,"context_line":"                    now - self.last_time \u003c self.ttl):"},{"line_number":512,"context_line":"                    # A cache hit."},{"line_number":513,"context_line":"                    return self.last_value"}],"source_content_type":"text/x-python","patch_set":2,"id":"64f865cc_97bce30a","line":510,"updated":"2023-03-17 07:25:34.000000000","message":"Since thread locking can also be expensive when done frequently without the need, I think we should move the cache hit path out of the lock.","commit_id":"eda7b0f6099d93a8ddffceed55abd4bb6d07d680"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"26c22b29ae650793786c11fb435aac4fe30a2dd3","unresolved":false,"context_lines":[{"line_number":507,"context_line":"                    finally:"},{"line_number":508,"context_line":"                        # Clear the future regardless so we don\u0027t loop."},{"line_number":509,"context_line":"                        self.future \u003d None"},{"line_number":510,"context_line":"                if (self.last_time is not None and"},{"line_number":511,"context_line":"                    now - self.last_time \u003c self.ttl):"},{"line_number":512,"context_line":"                    # A cache hit."},{"line_number":513,"context_line":"                    return self.last_value"}],"source_content_type":"text/x-python","patch_set":2,"id":"c4d36e01_8b572355","line":510,"in_reply_to":"64f865cc_97bce30a","updated":"2023-03-17 14:49:18.000000000","message":"Er, that else clause would be \"with lock\".","commit_id":"eda7b0f6099d93a8ddffceed55abd4bb6d07d680"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"a7d042e40ba689c3f650526a9e5c66a3468fd684","unresolved":false,"context_lines":[{"line_number":507,"context_line":"                    finally:"},{"line_number":508,"context_line":"                        # Clear the future regardless so we don\u0027t loop."},{"line_number":509,"context_line":"                        self.future \u003d None"},{"line_number":510,"context_line":"                if (self.last_time is not None and"},{"line_number":511,"context_line":"                    now - self.last_time \u003c self.ttl):"},{"line_number":512,"context_line":"                    # A cache hit."},{"line_number":513,"context_line":"                    return self.last_value"}],"source_content_type":"text/x-python","patch_set":2,"id":"a1ed8b75_23a40f42","line":510,"in_reply_to":"64f865cc_97bce30a","updated":"2023-03-17 14:48:10.000000000","message":"Okay, with a little duplication I think we can do what you ask:\nif cached data present and not expired and no pending future:\n  return cached data\nelse:\n  lines 502-532 exactly as written now.\n\nIt\u0027s a little duplicative, but efficient without added complexity.  I can do that if you want.","commit_id":"eda7b0f6099d93a8ddffceed55abd4bb6d07d680"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"5e7ae1516b533e569928400a04cafe8bcc58ebb3","unresolved":false,"context_lines":[{"line_number":507,"context_line":"                    finally:"},{"line_number":508,"context_line":"                        # Clear the future regardless so we don\u0027t loop."},{"line_number":509,"context_line":"                        self.future \u003d None"},{"line_number":510,"context_line":"                if (self.last_time is not None and"},{"line_number":511,"context_line":"                    now - self.last_time \u003c self.ttl):"},{"line_number":512,"context_line":"                    # A cache hit."},{"line_number":513,"context_line":"                    return self.last_value"}],"source_content_type":"text/x-python","patch_set":2,"id":"f7f2117b_b350e753","line":510,"in_reply_to":"64f865cc_97bce30a","updated":"2023-03-17 14:34:52.000000000","message":"Two things:\n1) timeit says the thread lock and unlock takes something like 0.00000014045762305613 seconds.  We will be calling this once or twice for every state machine advance, so we do want it to be fast, but we also really want to avoid errors, deadlocks, and extra API calls.  It\u0027s fast enough that I think we should set a high bar for redesign.\n2) The section above this needs to be in the lock because of the future check, so I don\u0027t see how to remove this section from the lock without adding more complexit.","commit_id":"eda7b0f6099d93a8ddffceed55abd4bb6d07d680"}]}
