Skip to content

Commit 8ce3507

Browse files
bosdbosd
authored andcommitted
Add handling for database serialization errors in import processing
- Add 'could not serialize access' and 'concurrent update' to scalable error detection - Add informative messages when database serialization conflicts are detected - Reduce chunk size and retry when serialization errors occur This addresses the 'could not serialize access due to concurrent update' errors that were causing import failures by treating them as scalable errors that can be resolved by reducing batch size.
1 parent 83627ca commit 8ce3507

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/odoo_data_flow/import_threaded.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,8 @@ def _execute_load_batch(
642642
or "gateway" in error_str
643643
or "proxy" in error_str
644644
or "timeout" in error_str
645+
or "could not serialize access" in error_str
646+
or "concurrent update" in error_str
645647
)
646648

647649
if is_scalable_error and chunk_size > 1:
@@ -650,6 +652,15 @@ def _execute_load_batch(
650652
f"[yellow]WARN:[/] Batch {batch_number} hit scalable error. "
651653
f"Reducing chunk size to {chunk_size} and retrying."
652654
)
655+
if (
656+
"could not serialize access" in error_str
657+
or "concurrent update" in error_str
658+
):
659+
progress.console.print(
660+
"[yellow]INFO:[/] Database serialization conflict detected. "
661+
"This is often caused by concurrent processes updating the same records. "
662+
"Retrying with smaller batch size."
663+
)
653664
continue
654665

655666
clean_error = str(e).strip().replace("\n", " ")

0 commit comments

Comments
 (0)