Project

General

Profile

Actions

Feature #12097

closed

Multi Thread Support

Added by Daniel Morgan about 12 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Rails support
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

Are there any plans for making Redmine thread safe in the future?
This is one of very important advantages of using Redmine with JRuby.

I have managed to enable config.threadsafe! with Redmine 1.4.x and gain thread safety to some extent.
However, I am really struggling to get it working with 2.x. (Mainly related to dependency loading disabled)

Will the Developers please consider thread safety in a future release.
My understanding is that config.threadsafe! will be a default in Rails 4.

For starters, the following fix was required in "app/models/user.rb" with 1.4.x:

  def self.current=(user)
    # @current_user = user
    Thread.current[:current_user] = user
  end

  def self.current
    # @current_user ||= User.anonymous
    Thread.current[:current_user] ||= User.anonymous
  end

This was to prevent current_user set by a user performing a bulk edit being overridden by a different user performing a concurrent request.


Files

config.threadsafe-r12424.diff (1.38 KB) config.threadsafe-r12424.diff Toshi MARUYAMA, 2013-12-21 03:43
unit-test-r12424.log.txt (7.66 KB) unit-test-r12424.log.txt Toshi MARUYAMA, 2013-12-21 03:43
rails4threadsafepatch.diff (2.98 KB) rails4threadsafepatch.diff Numa's diff for making Redmine work on Rails 4 Threadsafe modified, untested Christopher Mann, 2014-05-02 10:04
threadsafe_redmine_patch.diff (27.3 KB) threadsafe_redmine_patch.diff The correct diff file for Numa's implementation of Threadsafe. Christopher Mann, 2014-05-02 13:03
thread-r13171.diff (2.77 KB) thread-r13171.diff Toshi MARUYAMA, 2014-05-26 06:23
thread-r13171-1.diff (2.29 KB) thread-r13171-1.diff Toshi MARUYAMA, 2014-05-26 08:13

Related issues

Related to Redmine - Feature #14534: Upgrade to Rails 4.2ClosedJean-Philippe Lang

Actions
Actions

Also available in: Atom PDF