Project

General

Profile

Actions

Feature #36695

closed

Add check in Redmine information page if default queue adapter is used in production

Added by Marius BĂLTEANU almost 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Category:
Administration
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

Using the default queue adapter (:async) in production is not recommended because the queue is stored in memory and you can easily lose the items from the queue (https://api.rubyonrails.org/classes/ActiveJob/QueueAdapters/AsyncAdapter.html).

Since #26791, there were multiple issues reported caused by the default queue adapter (for example: #31241).

My proposal is to add the following check in Redmine information page:


Files

redmine_info.png (134 KB) redmine_info.png Marius BĂLTEANU, 2022-02-23 22:54
queue_adapter_changed.patch (26.7 KB) queue_adapter_changed.patch Karel Pičman, 2023-10-12 08:45
Actions #1

Updated by Marius BĂLTEANU almost 3 years ago

Maybe the following translation is better: "Default queue adapter changed (is well suited only for dev/test)".

Actions #2

Updated by Marius BĂLTEANU over 2 years ago

  • Target version set to 5.1.0
Actions #3

Updated by Go MAEDA about 1 year ago

  • Target version changed from 5.1.0 to 6.0.0
Actions #4

Updated by Karel Pičman about 1 year ago

Here is a patch, that implements the requested feature.

Actions #5

Updated by Mischa The Evil about 1 year ago

Karel Pičman wrote in #note-4:

Here is a patch, that implements the requested feature.

Thanks but FWIW: You may want to update the patch as there's a typo (text_defaut_queue_dapter_changed) included in the attached patch.

Actions #6

Updated by Marius BĂLTEANU about 1 year ago

  • Status changed from New to Resolved
  • Assignee set to Marius BĂLTEANU
  • Target version changed from 6.0.0 to 5.1.0
  • Resolution set to Fixed

Feature added in r22360. We had quite a lot of cases caused by this miss configuration, I found it useful to deliver it in 5.1.0.

Actions #7

Updated by Marius BĂLTEANU about 1 year ago

  • Status changed from Resolved to Closed
Actions #8

Updated by Mischa The Evil about 1 year ago

  • Status changed from Closed to Reopened

Marius BALTEANU wrote in #note-6:

Feature added in r22360. [...]

I'm not 100% sure, but I think there's a typo included in that commit (s/:asyncs/:async/). I'm also not sure about the intention of the added code-comment (#if Rails.env == 'production'). Is it a remnant of previous testing or was it intended to be un-commented before committing to show the warning only in production?

Actions #9

Updated by Marius BĂLTEANU about 1 year ago

Mischa The Evil wrote in #note-8:

Marius BALTEANU wrote in #note-6:

Feature added in r22360. [...]

I'm not 100% sure, but I think there's a typo included in that commit (s/:asyncs/:async/). I'm also not sure about the intention of the added code-comment (#if Rails.env == 'production'). Is it a remnant of previous testing or was it intended to be un-commented before committing to show the warning only in production?

Thanks Mischa for review my changes, you're right on both issues. I've committed the fixes now.

Actions #10

Updated by Mischa The Evil about 1 year ago

  • Status changed from Reopened to Resolved

Marius BALTEANU wrote in #note-9:

[...] I've committed the fixes now.

Thanks!

Actions #11

Updated by Marius BĂLTEANU about 1 year ago

  • Status changed from Resolved to Closed
Actions #12

Updated by Jonathan Cormier about 1 year ago

This redmine is the first thing that pops up if you search for the above warning. It would be nice if it could link to a wiki that explains what and how to change this so it's not using :Async

Actions #13

Updated by Jonathan Cormier about 1 year ago

If its that important i'd assume it should be mentioned in https://www.redmine.org/projects/redmine/wiki/RedmineInstall

Actions #14

Updated by ashraf alzyoud about 1 year ago

how we can resolve this ??
plz give us some information

Actions #15

Updated by Mischa The Evil about 1 year ago

Jonathan, ashraf: Redmine relies on Rails ActiveJob for email delivery since Redmine 4.0.0. This has been announced almost five years ago in Redmine 4.0.0, 3.4.7 and 3.3.9 released. Redmine administrators should have handled ActiveJob configuration with that release.
Given that we've seen lots of issues caused by this topic, this enhancement, that provides an admin notice, has been added. You can find more (general) info about Rails ActiveJob (configuration) in this Rails guide.
Additionally, Marius has added an example howto in the wiki that documents the installation and configuration steps for one, widely-used, job queuing library (Sidekiq).

Note: documentation for this topic has been part of the discussion in issue #33589.

Actions #16

Updated by Jonathan Cormier about 1 year ago

Thanks for the links Mischa. Hopefully, it will help others who are googling the new error as well.

Actions #17

Updated by Anthony Cartmell about 1 year ago

I didn't want to install Redis for Sidekiq, so went for SuckerPunch.

  1. cd <redmine-root>
  2. bundle add sucker_punch
  3. cp additional_environment.rb.example additional_environment.rb (if needed)
  4. vi additional_environment.rb to add config.active_job.queue_adapter = :sucker_punch
  5. restart Redmine
Actions #18

Updated by Jonathan Cormier about 1 year ago

Anthony Cartmell wrote in #note-17:

I didn't want to install Redis for Sidekiq, so went for SuckerPunch.

Note that sucker punch also only stores its jobs in memory so I'd be curious if it's any better than :Async. I too would prefer to not run a Redis server just for emails to work.

Actions #19

Updated by Guillermo ML about 1 year ago

Note that sucker punch also only stores its jobs in memory so I'd be curious if it's any better than :Async. I too would prefer to not run a Redis server just for emails to work.

The author of sucker_punch says that at this point is very similar to AsyncAdapter and he recommends to use it with Rails.
We tried both and stick with AsyncAdapter. We thought that it was overkill to set up a Redis server just to deliver mails and AsyncAdapter works fine.

Actions #20

Updated by ashraf alzyoud about 1 year ago

Jonathan Cormier wrote in #note-16:

Thanks for the links Mischa. Hopefully, it will help others who are googling the new error as well.

Mischa The Evil wrote in #note-15:

Jonathan, ashraf: Redmine relies on Rails ActiveJob for email delivery since Redmine 4.0.0. This has been announced almost five years ago in Redmine 4.0.0, 3.4.7 and 3.3.9 released. Redmine administrators should have handled ActiveJob configuration with that release.
Given that we've seen lots of issues caused by this topic, this enhancement, that provides an admin notice, has been added. You can find more (general) info about Rails ActiveJob (configuration) in this Rails guide.
Additionally, Marius has added an example howto in the wiki that documents the installation and configuration steps for one, widely-used, job queuing library (Sidekiq).

Note: documentation for this topic has been part of the discussion in issue #33589.

thx for your replay
1- im note in the example Sidekiq he only configure mailers, in my case im not using email bec im install redmine in my local network, its must configure or no?
2- can i use another queue mailer??
Configure Sidekiq

Create config/sidekiq.yml file inside Redmine directory and set the queues
---
:queues:
  - mailers

Actions

Also available in: Atom PDF