Bug 31616 - koha_worker isn't using RabbitMQ on startup if it's a local server.
Summary: koha_worker isn't using RabbitMQ on startup if it's a local server.
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 35092
  Show dependency treegraph
 
Reported: 2022-09-23 09:05 UTC by Didier Gautheron
Modified: 2023-10-18 18:42 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Didier Gautheron 2022-09-23 09:05:50 UTC
If RabbitMQ is on the same host that koha then koha_worker is started too early and it is unable to connect to RabbitMQ so it fallback to polling.
 
Example with koha-testing-docker 

rabbitmqctl list_channels
Listing channels ...
root@kohadevbox:kohadevbox$ 

No channels.

$ restart_all 
Restarting Apache httpd web server: apache2.
Restarting Koha ILS: koha-commonStopping Plack daemon for kohadev:.
Stopping Z39.50/SRU daemon for kohadev:.
Stopping Koha worker daemon for kohadev (default):.
Stopping Koha worker daemon for kohadev (long_tasks):.
Stopping Koha indexing daemon for kohadev:.
Starting Plack daemon for kohadev:.
Starting Z39.50/SRU daemon for kohadev:.
Starting Koha worker daemon for kohadev (default):.
Starting Koha worker daemon for kohadev (long_tasks):.
Starting Koha indexing daemon for kohadev:.
.
root@kohadevbox:kohadevbox$ rabbitmqctl list_channels
Listing channels ...
pid	user	consumer_count	messages_unacknowledged
<rabbit@kohadevbox.1663923239.864.0>	guest	1	0
<rabbit@kohadevbox.1663923239.883.0>	guest	1	0
root@kohadevbox:kohadevbox$ 

or double check with 
ss -ntp
port 61613 connections.
Comment 1 David Cook 2022-09-25 23:41:39 UTC
I'm not having this problem in prod on Ubuntu
Comment 2 Didier Gautheron 2022-11-21 11:05:15 UTC
(In reply to David Cook from comment #1)
> I'm not having this problem in prod on Ubuntu

Are rabbitmq and koha-worker.service running on the same host, i.e. connecting using 127.1 ?
Comment 3 David Cook 2022-11-21 22:27:16 UTC
(In reply to Didier Gautheron from comment #2)
> (In reply to David Cook from comment #1)
> > I'm not having this problem in prod on Ubuntu
> 
> Are rabbitmq and koha-worker.service running on the same host, i.e.
> connecting using 127.1 ?

There's no koha-worker.service when you're using Debian packages.

But yes RabbitMQ and the background_jobs_worker.pl processes are all running on the same host and communicating using "localhost" as the hostname for the RabbitMQ.