cschiewek/devise_ldap_authenticatable — Issue #73: Issue with multiple requests
Author: hartjus
Created: 2012-02-24 04:31:55+00:00
State: open

We are seeing an issue when multiple requests (threads?) that are accessing the ldap.yml file. Looking at the stack trace, the problem occurs in ldap_adapter.rb--in the initializer of LdapConnect where it performs the YAML.load() call. Not sure if an ldap connection pool is needed, or more protection around the loading of the YAML file?

This can be replicated by using the following test in a rails console:
threads = []
100.times {threads << Thread.new {p YAML.load(ERB.new(File.read(::Devise.ldap_config || "#{Rails.root}/config/ldap.yml")).result)[Rails.env]}}

Running ruby 1.9.2, rails 3.0.9 on Jruby 1.6.6 (same result on 1.6.7); Devise ldap authenticatable 0.4.9.