Bugzilla – Attachment 152249 Details for
Bug 33972
Remove unnecessary batch status change in C4::ImportBatch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33972: Set importing status to batch outside of transaction
Bug-33972-Set-importing-status-to-batch-outside-of.patch (text/plain), 1.74 KB, created by
Nick Clemens (kidclamp)
on 2023-06-09 13:39:11 UTC
(
hide
)
Description:
Bug 33972: Set importing status to batch outside of transaction
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-06-09 13:39:11 UTC
Size:
1.74 KB
patch
obsolete
>From 823d41b5cda76e6925099151166be96550a80140 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 9 Jun 2023 13:16:32 +0000 >Subject: [PATCH] Bug 33972: Set importing status to batch outside of > transaction > >This patch moves the setting of the 'importing' status for the batch >outside fo the transaction. > >This prevents a scenario seen on some setups where a deadlock is created: >background_jobs_worker.pl: C4::ImportBatch::SetImportBatchStatus(): DBI Exception: DBD::mysql::db do failed: Lock wait timeout exceeded; try restarting transaction at /usr/share/koha/lib/C4/ImportBatch.pm line 717 > >To test: >1 - Apply patch >2 - Stage and import some files >3 - Confirm the imports successfully complete >--- > C4/ImportBatch.pm | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index 65c0743ffd..790a1a6bae 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -536,6 +536,8 @@ sub BatchCommitRecords { > $progress_interval = 0 unless $progress_interval && $progress_interval =~ /^\d+$/; > $progress_interval = 0 unless ref($progress_callback) eq 'CODE'; > >+ SetImportBatchStatus($batch_id, 'importing'); >+ > my $schema = Koha::Database->schema; > $schema->txn_begin; > # NOTE: Moved this transaction to the front of the routine. Note that inside the while loop below >@@ -549,7 +551,6 @@ sub BatchCommitRecords { > my $num_items_errored = 0; > my $num_ignored = 0; > # commit (i.e., save, all records in the batch) >- SetImportBatchStatus($batch_id, 'importing'); > my $overlay_action = GetImportBatchOverlayAction($batch_id); > my $nomatch_action = GetImportBatchNoMatchAction($batch_id); > my $item_action = GetImportBatchItemAction($batch_id); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33972
:
152249
|
152400
|
152401
|
152409
|
152410
|
152654
|
152655
|
152738
|
152744