From 4d1eafc0a4773e6200fc4afd4e48c8d73e8ccff9 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sat, 27 Jun 2020 09:39:23 -0400 Subject: [PATCH] debug badrow --- lbry/db/query_context.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lbry/db/query_context.py b/lbry/db/query_context.py index 1fba3161a..b7aba73c0 100644 --- a/lbry/db/query_context.py +++ b/lbry/db/query_context.py @@ -568,7 +568,22 @@ class BulkLoader: execute = self.ctx.connection.execute for sql, rows in queries: for chunk_rows in chunk(rows, batch_size): - execute(sql, chunk_rows) + try: + execute(sql, chunk_rows) + except: + for row in chunk_rows: + try: + execute(sql, [row]) + except: + print(sql) + print(row) + with open('badrow', 'wb') as badrow: + badrow.write(str(sql).encode()) + badrow.write(repr(row).encode()) + p.ctx.message_queue.put_nowait( + (Event.COMPLETE.value, os.getpid(), 1, 1) + ) + raise if p: done += int(len(chunk_rows)/row_scale) p.step(done)