Go to file
Jonathan Druart f693fd2ea8 Bug 32393: Prevent invalid job to block the job queue
I have faced a problem when testing an incorrect version of bug 32370.
The frame sent to the message broker was not a correct JSON encoded
string, and its decoding was obviously failing, exploding the worker
script.
Additionally, as we don't send a ack for this frame, the next pull will
result in processing the same message, and so in the same explosion.
No more messages can be processed!

This patch is logging the error and ack the message to the broker, in
order to not get stuck.

Test plan:
0. Dont' apply this patch
1. Enqueue a bad message
  a. Apply 32370
  b. Comment the following line in Koha::BackgroundJob::enqueue
    $self->set_encoded_json_field( { data => $job_args,    field => 'data' } );
  c. restart_all
  d. Use the batch item modification tool to enqueue a new job
=> Notice the error in the log
=> Note that the status of the job is "new"
=> Inspect rabbitmq queue:
% rabbitmq-plugins enable rabbitmq_management
% rabbitmqadmin get queue=koha_kohadev-long_tasks
You will notice there is a message in the "long_tasks" queue
2. Enqueue a good message
  a. Remove the change from 1.b
  b. restart_all
  c. Enqueue another job
=> Same error in the log
=> Both jobs are new
=> Inspect rabbitmq, there are 2 messages
3. Apply this patch
4. restart_all
=> Second (good) job is finished
=> rabbitmq long_tasks queue is empty

We cannot mark the first job as done, we have no idea which job it was!

QA: Note that this patch is dealing with another problem, not tested in
this test plan. If an exception is not correctly caught by the ->process
method of the job, we won't crash the worker. The job will be marked as
failed.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ca9a598183)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2023-02-01 18:26:06 +00:00
C4 Bug 22042: [22.05.x] Block all return actions when BlockReturnOfWithdrawn items is set to block 2023-01-25 15:55:35 +00:00
Koha Bug 32394: [22.05.x] Restore long tasks queue 2023-02-01 18:19:34 +00:00
acqui Bug 32457: Fix CGI vulnerability in addorder.pl 2023-01-19 23:11:55 +00:00
admin Bug 32348: Add library public in columns settings 2023-01-19 23:50:14 +00:00
api Bug 30982: [22.05.x] Use the REST API for background job list view 2022-11-01 21:40:18 +00:00
authorities Bug 29333: Fix encoding of imported UNIMARC authorities 2022-08-23 15:30:11 +00:00
basket Bug 29871: Remove marcflavour param in Koha::Biblio->get_marc_notes 2022-07-12 15:54:27 +00:00
bin Bug 20582: Turn Koha into a Mojolicious application 2020-10-06 12:00:04 +02:00
catalogue Bug 30779: Remove _update_import_record_marc and update tests 2022-10-03 22:48:43 +00:00
cataloguing Bug 31873: Check ->find before calling ->safe_delete 2023-01-17 15:39:09 +00:00
circ Bug 31492: Set CSRF token in circulation.pl 2023-01-20 00:01:36 +00:00
clubs Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
course_reserves Bug 31893: Use checkauth and do not fetch about.tt template 2023-02-01 15:44:50 +00:00
debian Bug 32465: Add 'queue' to koha-worker help documentation 2023-01-24 18:56:22 +00:00
docs Bug 30808: Add the 22.05 release team. 2022-05-25 23:56:12 -10:00
errors Bug 29420: HTTP status code incorrect when calling error pages directly under Plack/PSGI 2022-04-20 09:03:39 -10:00
etc Bug 15048: Index all possible searched subfields for index-term-genre 2022-12-05 22:42:23 +00:00
ill Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
installer Increment version for 22.05.09 release 2023-01-25 21:36:13 +00:00
koha-tmpl Bug 32321: Pre-populate material type for 006 in advanced cataloging editor 2023-02-01 16:05:18 +00:00
labels Bug 31482: Label creator does not call barcodedecode 2022-11-10 23:43:49 +00:00
lib/CGI/Session/Serialize Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
members Bug 31893: Use checkauth and do not fetch about.tt template 2023-02-01 15:44:50 +00:00
misc Bug 32393: Prevent invalid job to block the job queue 2023-02-01 18:26:06 +00:00
offline_circ Bug 30525: Items batch modification broken 2022-04-21 13:41:36 -10:00
opac Bug 31739: Password recovery from staff fails if previous expired reset-entry exists. 2022-12-05 22:38:12 +00:00
patron_lists Bug 16446: Add ability to add patrons to list by borrowernumber 2021-10-21 12:24:04 +02:00
patroncards Bug 24001: Fix patron card template edition 2022-04-28 10:49:20 -10:00
plugins Bug 29787: Add plugin version to plugin search results 2022-04-08 15:49:15 +02:00
pos Bug 28481: (RM follow-up) formatting 2021-12-16 12:13:51 -10:00
recalls Bug 30924: Add missing branchtransfers.reason value for recall cancellation 2022-07-13 19:13:33 +00:00
reports Bug 28967: Patrons with no checkouts report shows patrons from other libraries with IndependentBranches 2022-12-05 20:23:34 +00:00
reserve Bug 31893: Use checkauth and do not fetch about.tt template 2023-02-01 15:44:50 +00:00
reviews Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
rotating_collections Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
serials Bug 29608: Made so doesn't require full permission 2022-10-31 19:55:45 +00:00
services Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
skel
…
suggestion Bug 30127: By default show pending suggestions tab 2022-05-10 23:09:09 -10:00
svc Bug 31682: Silence automatic linker warn 2022-12-05 18:15:20 +00:00
t Bug 32394: [22.05.x] Add tests 2023-02-01 18:19:34 +00:00
tags Bug 29469: (bug 17600 follow-up) Fix tag approval/rejection from staff 2021-11-16 15:49:22 +01:00
tmp/modified_authorities
…
tools Bug 32221: Borrowers.password should no longer be an option 2023-02-01 15:40:12 +00:00
virtualshelves Bug 29114: Trim whitespace before the barcode 2022-08-23 19:29:20 +00:00
xt Bug 32349: Remove find-nonutf8 tests 2023-01-24 18:22:03 +00:00
.editorconfig Bug 27375: Set YAML file settings in .editorconfig 2021-11-03 15:40:52 +01:00
.eslintrc.json Bug 23834: Add default ESLint configuration 2019-11-03 08:02:39 +00:00
.gitignore Bug 20427: Convert OPAC LESS to SCSS 2018-08-09 15:17:07 +00:00
.htaccess
…
.mailmap 22.05.00: Update mailmap 2022-05-25 23:56:12 -10:00
.perlcriticrc Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
.proverc.dist Bug 19821: Install sample data, ES mappings and Version syspref 2021-10-25 11:27:40 +02:00
.scss-lint.yml Bug 21237: Clean up staff client SCSS 2018-08-24 16:23:25 +00:00
INSTALL Bug 26617: Update INSTALL file to include koha-testing-docker and Gitlab links 2020-10-15 12:56:30 +02:00
Koha.pm Increment version for 22.05.09 release 2023-01-25 21:36:13 +00:00
LICENSE
…
MANIFEST.SKIP
…
Makefile.PL Bug 19532: Database and installer stuff 2022-03-14 22:45:50 -10:00
README
…
README.md Bug 27092: Remove note about "synced repo" from README.md 2020-11-25 16:31:58 +01:00
README.robots
…
about.pl Bug 27667: Display a warning for records missing in Elasticsearch 2022-08-23 19:26:34 +00:00
app.psgi Bug 20582: Fix PSGI file when behind a reverse proxy 2020-10-06 12:00:04 +02:00
changelanguage.pl Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
cpanfile Bug 31588 - Update cpanfile for new OpenAPI versions (22.05) 2022-12-05 21:23:00 +00:00
fix-perl-path.PL Bug 28606: Remove $DEBUG and $ENV{DEBUG} 2021-06-24 11:53:44 +02:00
gulpfile.js Bug 30373: Enable translation of UNIMARC frameworks 2022-04-21 13:41:35 -10:00
help.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
koha_perl_deps.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
kohaversion.pl Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
mainpage.pl Bug 29020: Add link on the mainpage for users without admin access 2021-10-19 09:29:09 +02:00
package.json Bug 27939: Update yarn.lock file 2021-03-16 12:04:06 +01:00
rewrite-config.PL Bug 28519: Put CGI::Session::Serialize::yamlxs in lib directory 2021-06-17 10:07:36 +02:00
yarn.lock Bug 27939: Update yarn.lock file 2021-03-16 12:04:06 +01:00

README.md

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo