プロジェクト

全般

プロフィール

Vote #70461

完了

LDAP timeout if an LDAP auth provider is unreachable

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
LDAP_28
対象バージョン:
開始日:
2011/08/03
期日:
進捗率:

0%

予定工数:
category_id:
28
version_id:
47
issue_org_id:
8978
author_id:
5588
assigned_to_id:
1
comments:
9
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Hi

we are using Redmine with a like 3 different LDAP auth sources, and sometimes if one of the goes down, almsot every process involved with Redmine slow down terribly.
It seems that when some use rtry to log in, Redmien try to contact the server that's not responding, waiting indefinitely for the action to be completed, making everything slow. There should be a (configurable perhaps?) timeout (I think that a sane default could be 30 seconds), and then the LDAP source should be considered dead (at least for that request).

i'm using Redmine 1.1.2.stable.5317


journals

you can try if "redmine_ldap_sync":https://github.com/thorin/redmine_ldap_sync can handle this better.
--------------------------------------------------------------------------------
I can confirm this happens in 2.0.3 as well. We used to use LDAP to authenticate and when we took our LDAP system offline I forgot some users were still configured and instead of seeing a message about unable to log in or LDAP authentication server unreachable, it gave a 500 error.
--------------------------------------------------------------------------------
Here's a quick patch I made against 2.0.3. This will catch a timeout error after 30 seconds and redirect the user with a proper error message. This is english only and really is a proof-of-concept. Ideally the timeout would default to 30 seconds but could be modified via the administration settings (or per-LDAP definition).

Perhaps the Timeout class is not the best solution in this case; however, from my testing it works.
--------------------------------------------------------------------------------
Brett Patterson wrote:
> Perhaps the Timeout class is not the best solution in this case; however, from my testing it works.

Actually seems to be a great idea.

--------------------------------------------------------------------------------
Worked on it some more and now the timeout is configurable on a per-connection basis in the LDAP settings. If no timeout value is set, the default of 20 is set.

In order to use this, the following SQL must be run:

<pre><code>ALTER TABLE `auth_sources` ADD COLUMN `timeout` int(11) DEFAULT NULL AFTER `port`;</code></pre>
--------------------------------------------------------------------------------
Is there a good reason to set the timeout for each LDAP instead of a global setting?
--------------------------------------------------------------------------------
A good reason not really. It may be preferable to have "local" LDAP connections have a faster timeout than remote ones, so there may be some instances where adding an extra second here and there is preferable.
--------------------------------------------------------------------------------
Feature added in r9931 with slight changes and test. Thanks.
--------------------------------------------------------------------------------
Thanks a lot!
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリLDAP_28 にセット
  • 対象バージョン2.1.0_47 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0