Bugzilla – Attachment 179216 Details for
Bug 34070
background_jobs_worker.pl floods logs when it gets error frames
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34070: Deal with broker connection issues
Bug-34070-Deal-with-broker-connection-issues.patch (text/plain), 1.65 KB, created by
Jonathan Druart
on 2025-03-12 15:23:26 UTC
(
hide
)
Description:
Bug 34070: Deal with broker connection issues
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-03-12 15:23:26 UTC
Size:
1.65 KB
patch
obsolete
>From b277953e917bb6788c15ea0b6b5f7f68f71b05d0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 10 Mar 2025 10:54:25 +0100 >Subject: [PATCH] Bug 34070: Deal with broker connection issues > >This patch suggests to deal with connection issues at >Koha::BackgroundJob->connect level. >It incorrectly returned a Net::Stomp object when the connection failed. >With this patch, if the CONNECT does not return a CONNECTED frame then >Koha::BackgroundJob->connect returns nothing and the caller is not >fooled. > >It also fixes the about page, we now have: > "Using SQL polling (Fallback, Error connecting to RabbitMQ)" >instead of > "Using RabbitMQ" > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > Koha/BackgroundJob.pm | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > >diff --git a/Koha/BackgroundJob.pm b/Koha/BackgroundJob.pm >index 4ca7603377b..48f9e08dd33 100644 >--- a/Koha/BackgroundJob.pm >+++ b/Koha/BackgroundJob.pm >@@ -89,10 +89,16 @@ sub connect { > > try { > $stomp = Net::Stomp->new( { hostname => $hostname, port => $port } ); >- $stomp->connect($credentials); >+ my $connected_frame = $stomp->connect($credentials); >+ if ( $connected_frame->command ne 'CONNECTED' ) { >+ my $message = $connected_frame->body; >+ chomp $message; >+ warn sprintf "Cannot connect to broker (%s)", $message; >+ undef $stomp; >+ } > } catch { >- warn "Cannot connect to broker " . $_; >- $stomp = undef; >+ warn sprintf "Cannot connect to broker (%s)", $_; >+ undef $stomp; > }; > > return $stomp; >-- >2.34.1
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 34070
:
178068
|
179024
|
179025
|
179094
|
179095
|
179214
|
179215
|
179216
|
179217
|
179218
|
182570
|
182571
|
182572
|
182573
|
182574