Skip to content
  1. Jun 19, 2015
  2. Jun 18, 2015
  3. Jun 17, 2015
  4. Jun 16, 2015
    • ziirish's avatar
      remove unused file · 9e8b883a
      ziirish authored
      9e8b883a
    • ziirish's avatar
      Merge branch 'master' into 'master' · d6af10c6
      ziirish authored
      Use RESTARTABLE client_strategy for persistent Connections
      
      Fixes for #64 for AD. Changes the Connection used for doing ldap searches (ie. fetch()) to attempt to re-connect if the server has closed the socket. Note that Connections used for binding (ie. check()) use the default SYNC strategy.
      
      String representations of the Connection are incredibly useful.
      
      ```
      2015-06-16 10:24:52 [21634] [DEBUG] POST /login
      filter: (&(sAMAccountName=wade.fitzpatrick)(|(userAccountControl=512)(userAccountControl=66048))) | base: OU=Systems,OU=Employees,DC=corp,DC=net,DC=au
      LDAP Connection = ldaps://corp.net.au:636 - ssl - user: CN=LDAP Read,CN=Users,DC=corp,DC=net,DC=au - bound - open - <local: 10.137.1.140:60119 - remote: 10.137.1.193:636> - tls not started - listening - RestartableStrategy
      Found DN: CN=Wade Fitzpatrick,OU=Systems,OU=Employees,DC=corp,DC=net,DC=au
      filter: (&(sAMAccountName=wade.fitzpatrick)(|(userAccountControl=512)(userAccountControl=66048))) | base: OU=Systems,OU=Employees,DC=corp,DC=net,DC=au
      LDAP Connection = ldaps://corp.net.au:636 - ssl - user: CN=LDAP Read,CN=Users,DC=corp,DC=net,DC=au - bound - open - <local: 10.137.1.140:60119 - remote: 10.137.1.193:636> - tls not started - listening - RestartableStrategy
      Found DN: CN=Wade Fitzpatrick,OU=Systems,OU=Employees,DC=corp,DC=net,DC=au
      LDAP Connection = ldaps://corp.net.au:636 - ssl - user: CN=Wade Fitzpatrick,OU=Systems,OU=Employees,DC=corp,DC=net,DC=au - bound - open - <local: 10.137.1.140:60417 - remote: 10.137.1.193:636> - tls not started - listening - SyncStrategy
      Bound as user: CN=Wade Fitzpatrick,OU=Systems,OU=Employees,DC=corp,DC=net,DC=au
      2015-06-16 10:24:53 [21634] [DEBUG] Closing connection.
      2015-06-16 10:24:53 [21634] [DEBUG] GET /
      2015-06-16 10:24:53 [21634] [DEBUG] Closing connection.
      ```
      
      And below, running 5 worker threads under gunicorn, we can see the number of connections decrease then reconnect as needed:
      ```
      root@rubicon:~# netstat -anp |grep  :636
      tcp        0      0 10.137.1.140:60119       10.137.1.193:636         ESTABLISHED 21634/python
      tcp        0      0 10.137.1.140:60117       10.137.1.193:636         ESTABLISHED 21625/python
      tcp        0      0 10.137.1.140:60116       10.137.1.193:636         ESTABLISHED 21627/python
      tcp        0      0 10.137.1.140:60120       10.137.1.193:636         ESTABLISHED 21636/python
      tcp        0      0 10.137.1.140:60118       10.137.1.193:636         ESTABLISHED 21626/python
      tcp6       0      0 10.137.1.140:52366       10.137.1.193:636         ESTABLISHED 12140/java
      root@rubicon:~# netstat -anp |grep  :636
      tcp6       0      0 10.137.1.140:52366       10.137.1.193:636         ESTABLISHED 12140/java
      root@rubicon:~# netstat -anp |grep  :636
      tcp        0      0 10.137.1.140:36869       10.137.1.193:636         ESTABLISHED 21634/python
      tcp6       0      0 10.137.1.140:52366       10.137.1.193:636         ESTABLISHED 12140/java
      ```
      
      See merge request !2
      
      fixes #64
      d6af10c6
    • ziirish's avatar
      a few fixes for !2 · 66915e9e
      ziirish authored
      66915e9e
    • Wade Fitzpatrick's avatar
  5. Jun 15, 2015
  6. Jun 14, 2015
  7. Jun 12, 2015