)]}'
{"barbican/model/repositories.py":[{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"a7d2fcfe077619af412c842d60bbdc7ff116e601","unresolved":false,"context_lines":[{"line_number":1014,"context_line":""},{"line_number":1015,"context_line":"            self.save(kek_datum)"},{"line_number":1016,"context_line":"        else:"},{"line_number":1017,"context_line":"            kek_datum \u003d kek_datums.pop()"},{"line_number":1018,"context_line":""},{"line_number":1019,"context_line":"            # (alee)  There should be only one active KEKDatum."},{"line_number":1020,"context_line":"            # Due to a race condition with many threads or"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_1865b2e1","line":1017,"range":{"start_line":1017,"start_character":24,"end_line":1017,"end_character":40},"updated":"2019-01-24 09:51:06.000000000","message":"how could you do a pop() here, if there would be no kek_datums?","commit_id":"36ade0c74814251f71b5c5e450d5b294ac9ea553"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"8506afe06506f872aad9c23f0900402c13123d44","unresolved":false,"context_lines":[{"line_number":1014,"context_line":""},{"line_number":1015,"context_line":"            self.save(kek_datum)"},{"line_number":1016,"context_line":"        else:"},{"line_number":1017,"context_line":"            kek_datum \u003d kek_datums.pop()"},{"line_number":1018,"context_line":""},{"line_number":1019,"context_line":"            # (alee)  There should be only one active KEKDatum."},{"line_number":1020,"context_line":"            # Due to a race condition with many threads or"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_47a837da","line":1017,"range":{"start_line":1017,"start_character":24,"end_line":1017,"end_character":40},"in_reply_to":"9fdfeff1_1865b2e1","updated":"2019-01-24 15:00:37.000000000","message":"If there are no kek_datums, then we\u0027ll be in the first clause of the if -statement -- ie. lines 1007-1015 above.  So we won\u0027t get to this statement.","commit_id":"36ade0c74814251f71b5c5e450d5b294ac9ea553"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"a894784eb9af766e315540f14b3f5a0f70a6dd9a","unresolved":false,"context_lines":[{"line_number":1014,"context_line":""},{"line_number":1015,"context_line":"            self.save(kek_datum)"},{"line_number":1016,"context_line":"        else:"},{"line_number":1017,"context_line":"            kek_datum \u003d kek_datums.pop()"},{"line_number":1018,"context_line":""},{"line_number":1019,"context_line":"            # (alee)  There should be only one active KEKDatum."},{"line_number":1020,"context_line":"            # Due to a race condition with many threads or"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_f2f32209","line":1017,"range":{"start_line":1017,"start_character":24,"end_line":1017,"end_character":40},"in_reply_to":"9fdfeff1_47a837da","updated":"2019-01-24 20:20:50.000000000","message":"oh, lol, that makes sense. somehow I misread this. And we can\u0027t do locking here, I guess... right?","commit_id":"36ade0c74814251f71b5c5e450d5b294ac9ea553"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"0959f7d088bb18dbb39ed58a89d23549d0b08ba9","unresolved":false,"context_lines":[{"line_number":1014,"context_line":""},{"line_number":1015,"context_line":"            self.save(kek_datum)"},{"line_number":1016,"context_line":"        else:"},{"line_number":1017,"context_line":"            kek_datum \u003d kek_datums.pop()"},{"line_number":1018,"context_line":""},{"line_number":1019,"context_line":"            # (alee)  There should be only one active KEKDatum."},{"line_number":1020,"context_line":"            # Due to a race condition with many threads or"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fdfeff1_f2dd6242","line":1017,"range":{"start_line":1017,"start_character":24,"end_line":1017,"end_character":40},"in_reply_to":"9fdfeff1_f2f32209","updated":"2019-01-24 20:38:44.000000000","message":"yup - no locking -- as we need to support galera.","commit_id":"36ade0c74814251f71b5c5e450d5b294ac9ea553"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"c416b97f80d76d23a39ce1bd85c81ba54bc759c8","unresolved":false,"context_lines":[{"line_number":1028,"context_line":"                    \"Setting %s to be inactive.\","},{"line_number":1029,"context_line":"                    project.external_id,"},{"line_number":1030,"context_line":"                    kd.kek_label)"},{"line_number":1031,"context_line":"                kd.active \u003d False"},{"line_number":1032,"context_line":"                self.save(kd)"},{"line_number":1033,"context_line":""},{"line_number":1034,"context_line":"        return kek_datum"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_2ff133ce","line":1031,"updated":"2019-01-25 15:47:16.000000000","message":"Maybe we should check for current status first?  If some are already inactive, we can skip hitting the db for those.","commit_id":"6061e88fc195456e03eb46c964ca28862247a38f"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"c4b59db3bba202e6240efc17a5eab8854f8c69ab","unresolved":false,"context_lines":[{"line_number":1028,"context_line":"                    \"Setting %s to be inactive.\","},{"line_number":1029,"context_line":"                    project.external_id,"},{"line_number":1030,"context_line":"                    kd.kek_label)"},{"line_number":1031,"context_line":"                kd.active \u003d False"},{"line_number":1032,"context_line":"                self.save(kd)"},{"line_number":1033,"context_line":""},{"line_number":1034,"context_line":"        return kek_datum"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_ca1175ae","line":1031,"in_reply_to":"9fdfeff1_2ff133ce","updated":"2019-01-25 16:54:33.000000000","message":"The query above already selects for those that are active.\nSee line 999.","commit_id":"6061e88fc195456e03eb46c964ca28862247a38f"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"2fa3cb11ef474ad235a478c1d8bc84dfc027eadd","unresolved":false,"context_lines":[{"line_number":1028,"context_line":"                    \"Setting %s to be inactive.\","},{"line_number":1029,"context_line":"                    project.external_id,"},{"line_number":1030,"context_line":"                    kd.kek_label)"},{"line_number":1031,"context_line":"                kd.active \u003d False"},{"line_number":1032,"context_line":"                self.save(kd)"},{"line_number":1033,"context_line":""},{"line_number":1034,"context_line":"        return kek_datum"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_9e288e34","line":1031,"in_reply_to":"9fdfeff1_ca1175ae","updated":"2019-01-25 17:34:29.000000000","message":"Ah, I see.  LGTM, then.","commit_id":"6061e88fc195456e03eb46c964ca28862247a38f"},{"author":{"_account_id":10873,"name":"Juan Antonio Osorio Robles","email":"jaosorior@redhat.com","username":"ejuaoso"},"change_message_id":"b85f85b2d5af66bba3b623a92e9ac024341658b8","unresolved":false,"context_lines":[{"line_number":1022,"context_line":"            # multiple active KEKDatum.  The code below makes"},{"line_number":1023,"context_line":"            # all the extra KEKDatum inactive"},{"line_number":1024,"context_line":"            # See LP#1726378"},{"line_number":1025,"context_line":"            for kd in kek_datums:"},{"line_number":1026,"context_line":"                LOG.debug("},{"line_number":1027,"context_line":"                    \"Multiple active KEKDatum found for %s.\""},{"line_number":1028,"context_line":"                    \"Setting %s to be inactive.\","},{"line_number":1029,"context_line":"                    project.external_id,"},{"line_number":1030,"context_line":"                    kd.kek_label)"},{"line_number":1031,"context_line":"                kd.active \u003d False"},{"line_number":1032,"context_line":"                self.save(kd)"},{"line_number":1033,"context_line":""},{"line_number":1034,"context_line":"        return kek_datum"},{"line_number":1035,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_7bef06b0","line":1032,"range":{"start_line":1025,"start_character":12,"end_line":1032,"end_character":29},"updated":"2019-01-25 06:38:07.000000000","message":"will this survive in a multi-process/threaded environment? Seems to me like there is the possibility of this being executed by several processes as well, leading to undesirable results (all keks inactive worst case?)","commit_id":"6061e88fc195456e03eb46c964ca28862247a38f"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"bc55d2b2a913ffc7053102ed9b5b75a93a89d98b","unresolved":false,"context_lines":[{"line_number":1022,"context_line":"            # multiple active KEKDatum.  The code below makes"},{"line_number":1023,"context_line":"            # all the extra KEKDatum inactive"},{"line_number":1024,"context_line":"            # See LP#1726378"},{"line_number":1025,"context_line":"            for kd in kek_datums:"},{"line_number":1026,"context_line":"                LOG.debug("},{"line_number":1027,"context_line":"                    \"Multiple active KEKDatum found for %s.\""},{"line_number":1028,"context_line":"                    \"Setting %s to be inactive.\","},{"line_number":1029,"context_line":"                    project.external_id,"},{"line_number":1030,"context_line":"                    kd.kek_label)"},{"line_number":1031,"context_line":"                kd.active \u003d False"},{"line_number":1032,"context_line":"                self.save(kd)"},{"line_number":1033,"context_line":""},{"line_number":1034,"context_line":"        return kek_datum"},{"line_number":1035,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_4f035710","line":1032,"range":{"start_line":1025,"start_character":12,"end_line":1032,"end_character":29},"in_reply_to":"9fdfeff1_6fe73b14","updated":"2019-01-25 16:11:33.000000000","message":"@Juan, I do think this solution is a bit hacky, but the only other option I can think of is to use a distributed lock in something like etcd, which is a huge dependency change. :-\\","commit_id":"6061e88fc195456e03eb46c964ca28862247a38f"},{"author":{"_account_id":7973,"name":"Douglas Mendizábal","email":"dmendiza@redhat.com","username":"dougmendizabal"},"change_message_id":"c416b97f80d76d23a39ce1bd85c81ba54bc759c8","unresolved":false,"context_lines":[{"line_number":1022,"context_line":"            # multiple active KEKDatum.  The code below makes"},{"line_number":1023,"context_line":"            # all the extra KEKDatum inactive"},{"line_number":1024,"context_line":"            # See LP#1726378"},{"line_number":1025,"context_line":"            for kd in kek_datums:"},{"line_number":1026,"context_line":"                LOG.debug("},{"line_number":1027,"context_line":"                    \"Multiple active KEKDatum found for %s.\""},{"line_number":1028,"context_line":"                    \"Setting %s to be inactive.\","},{"line_number":1029,"context_line":"                    project.external_id,"},{"line_number":1030,"context_line":"                    kd.kek_label)"},{"line_number":1031,"context_line":"                kd.active \u003d False"},{"line_number":1032,"context_line":"                self.save(kd)"},{"line_number":1033,"context_line":""},{"line_number":1034,"context_line":"        return kek_datum"},{"line_number":1035,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_6fe73b14","line":1032,"range":{"start_line":1025,"start_character":12,"end_line":1032,"end_character":29},"in_reply_to":"9fdfeff1_7bef06b0","updated":"2019-01-25 15:47:16.000000000","message":"I want to say that this will work regardless of numbers of processes/threads.\n\nBecause the query is ordered, every process will pop() the latest KEKDatum.  Even if every process gets a different KEKDatum, at least one process will keep its KEKDatum ACTIVE.","commit_id":"6061e88fc195456e03eb46c964ca28862247a38f"}]}
