)]}'
{"octavia/db/repositories.py":[{"author":{"_account_id":6469,"name":"Carlos Gonçalves","display_name":"Carlos Goncalves","email":"cgoncalves@redhat.com","username":"cgoncalves"},"change_message_id":"ece42e6cdf62f456434122c438d4040856aee741","unresolved":false,"context_lines":[{"line_number":1801,"context_line":"        \"\"\""},{"line_number":1802,"context_line":"        row \u003d lock_session.query(models.SparesPool).with_for_update().first()"},{"line_number":1803,"context_line":"        if not row:"},{"line_number":1804,"context_line":"            updated_at \u003d (datetime.datetime.utcnow() -"},{"line_number":1805,"context_line":"                          datetime.timedelta("},{"line_number":1806,"context_line":"                              seconds\u003dCONF.house_keeping.spare_check_interval))"},{"line_number":1807,"context_line":"            row \u003d models.SparesPool(updated_at\u003dupdated_at)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_bcfb3fbc","line":1804,"updated":"2019-04-03 17:32:55.000000000","message":"Why do we need to set updated_at here and why current time minus spare check interval?\n\nTime is being set in https://github.com/openstack/octavia/blob/147a340f4031d13bd196adb2fd7204db7a7bd5c5/octavia/controller/housekeeping/house_keeping.py#L74","commit_id":"05d3de7c4c5d70aafdafc8379fd73be99a7e86fe"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"927f225c6a55858c1e2b8efd476606a7a0ffff65","unresolved":false,"context_lines":[{"line_number":1801,"context_line":"        \"\"\""},{"line_number":1802,"context_line":"        row \u003d lock_session.query(models.SparesPool).with_for_update().first()"},{"line_number":1803,"context_line":"        if not row:"},{"line_number":1804,"context_line":"            updated_at \u003d (datetime.datetime.utcnow() -"},{"line_number":1805,"context_line":"                          datetime.timedelta("},{"line_number":1806,"context_line":"                              seconds\u003dCONF.house_keeping.spare_check_interval))"},{"line_number":1807,"context_line":"            row \u003d models.SparesPool(updated_at\u003dupdated_at)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_27de583e","line":1804,"in_reply_to":"5fc1f717_277f3867","updated":"2019-04-03 18:26:00.000000000","message":"Confirmed, an empty record set will not lock the table, so this re-introduces the startup race.","commit_id":"05d3de7c4c5d70aafdafc8379fd73be99a7e86fe"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"fc244ffe726b2f63d42526beaf61233327725c02","unresolved":false,"context_lines":[{"line_number":1801,"context_line":"        \"\"\""},{"line_number":1802,"context_line":"        row \u003d lock_session.query(models.SparesPool).with_for_update().first()"},{"line_number":1803,"context_line":"        if not row:"},{"line_number":1804,"context_line":"            updated_at \u003d (datetime.datetime.utcnow() -"},{"line_number":1805,"context_line":"                          datetime.timedelta("},{"line_number":1806,"context_line":"                              seconds\u003dCONF.house_keeping.spare_check_interval))"},{"line_number":1807,"context_line":"            row \u003d models.SparesPool(updated_at\u003dupdated_at)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_277f3867","line":1804,"in_reply_to":"5fc1f717_bcfb3fbc","updated":"2019-04-03 18:14:21.000000000","message":"We need to set it to \"something\" for DB compatibility. Not all of the engines will allow a row with no content at all.\nThat said, it could be just utcnow.\n\nMy question is if first() returns no rows, it shouldn\u0027t be locked, so this code will leave the first run unlocked I think.","commit_id":"05d3de7c4c5d70aafdafc8379fd73be99a7e86fe"}]}
