Skip to content
Snippets Groups Projects

Optimize LDAP and add a search timeout

Merged Drew Blessing requested to merge dblessing/gitlab-ce:optimize_ldap into master

Related to #4282 (moved)

This merge request arranges some things in access.rb to facilitate some optimizations in EE (to come later). It also adds a 10 second timeout to all LDAP searches so the entire worker is not blocked if some query doesn't return in a reasonable amount of time. This timeout is configurable per LDAP server.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Drew Blessing Added 1 commit:

    Added 1 commit:

    • 025ab11f - Optimize LDAP and add a search timeout
  • Drew Blessing Added 1 commit:

    Added 1 commit:

    • eafd8c61 - Optimize LDAP and add a search timeout
  • Drew Blessing Added 1 commit:

    Added 1 commit:

    • d8de2867 - Optimize LDAP and add a search timeout
  • Drew Blessing Added 1 commit:

    Added 1 commit:

    • b3adaf27 - Optimize LDAP and add a search timeout
  • Drew Blessing Added 1 commit:

    Added 1 commit:

    • cc238e31 - Optimize LDAP and add a search timeout
  • 5 5 module Gitlab
    6 6 module LDAP
    7 7 class Access
    8 attr_reader :adapter, :provider, :user
    8 attr_reader :provider, :user
  • Author Maintainer

    @rspeicher I changed the default to 10.seconds as you suggested.

    I also changed this to use Ruby's Timeout class instead of Net::LDAP's timeout. When I simulated a connection hang with toxiproxy I found Net::LDAP's timeout doesn't work, but Ruby's does. I raised an issue with the ruby-net-ldap project.

    Can we pull this in for the next patch, please?

  • Robert Speicher Milestone changed to 8.3

    Milestone changed to 8.3

  • mentioned in issue #5547 (closed)

  • /cc @marin gitlab.yml changes!

    Edited by username-removed-2900
  • Author Maintainer

    @marin @rspeicher We shouldn't need to change anything on Omnibus because the change was inside of the YAML part of LDAP config. :thumbsup:

  • @dblessing Be sure to assign for final review and merge.

  • We shouldn't need to change anything on Omnibus because the change was inside of the YAML part of LDAP config.

    Not sure that's right. If we add a setting to gitlab.yml it usually needs to be reflected in Omnibus, right?

  • Reassigned to @DouweM

  • Author Maintainer

    Not sure that's right. If we add a setting to gitlab.yml it usually needs to be reflected in Omnibus, right?

    Normally, yes. But here there's no new key because it's just a new piece inside the embedded YAML.

    # gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' # remember to close this block with 'EOS' below
    #   main: # 'main' is the GitLab 'provider ID' of this LDAP server
    #     label: 'LDAP'
    #     host: '_your_ldap_server'
    #     port: 389
    #     uid: 'sAMAccountName'
    #     method: 'plain' # "tls" or "ssl" or "plain"
    #     bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
    #     password: '_the_password_of_the_bind_user'
    #     timeout: 30
    ...
  • Drew Blessing Added 228 commits:

    Added 228 commits:

    • cc238e31...87000b25 - 227 commits from branch gitlab-org:master
    • f006a928 - Optimize LDAP and add a search timeout
  • Drew Blessing Added 1 commit:

    Added 1 commit:

    • 13be89d9 - Optimize LDAP and add a search timeout
  • Douwe Maan
    Douwe Maan @DouweM started a thread on the diff
  • 27 28 - Ajax filter by message for commits page
    28 29
    29 30 v 8.3.3 (unreleased)
    31 - Add configurable LDAP server query timeout
  • Reassigned to @dbalexandre

  • Reassigned to @dblessing

  • /cc @marin gitlab.yml changes!

    Thanks for the ping @razer6 !

    @marin @rspeicher We shouldn't need to change anything on Omnibus because the change was inside of the YAML part of LDAP config.

    @dblessing Correct! One of the advantages of the current way of specifying LDAP settings.

    Edited by Marin Jankovski
  • Drew Blessing Added 100 commits:

    Added 100 commits:

  • Author Maintainer

    @DouweM Thanks for the feedback. I removed dup CHANGELOG and changed to . instead of ::.

  • Reassigned to @DouweM

  • Douwe Maan Enabled an automatic merge when the build for dblessing/gitlab-ce@67aa0b8c4cbf762211ad178efb537f1649d91776 succeeds

    Enabled an automatic merge when the build for dblessing/gitlab-ce@67aa0b8c4cbf762211ad178efb537f1649d91776 succeeds

  • Douwe Maan Status changed to merged

    Status changed to merged

  • Douwe Maan mentioned in commit 49f51ff1

    mentioned in commit 49f51ff1

  • Douwe Maan mentioned in commit 76ec8a11

    mentioned in commit 76ec8a11

  • Please register or sign in to reply
    Loading