[jira] Created: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 - 3 | Next >

[jira] Created: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
-----------------------------------------------------------------------------------

                 Key: DIRSERVER-1369
                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
             Project: Directory ApacheDS
          Issue Type: Bug
    Affects Versions: 1.5.4
         Environment: Windows-xp, JDK-1.5
            Reporter: Murali Krishna
            Priority: Critical


This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
Please find the java program at the bottom.

Steps to reproduce:
1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
3. Also create the entry dc=example,dc=com
4. Run the java program provided below.

Actual Result:
The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
        Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
: null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.

As a result, the server gets into an inconsistent state and unoperational.

Expected Result:
The server should continuously bind and unbind the java hash table object.

What could have caused this and how do we correct this.
Are there any specific configurations to be made in the server.xml.
I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
This is very important for us and do help us in this regard.

Java program:

import java.util.Date;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;

import javax.naming.CommunicationException;
import javax.naming.Context;
import javax.naming.NameAlreadyBoundException;
import javax.naming.NameNotFoundException;
import javax.naming.NamingException;
import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;

import com.telelogic.tds.common.TDSConstants;
import com.telelogic.tds.common.TDSProperties;
import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;

public class MultiThreadedTest extends Thread {

    @Override
    public void run() {

        try {

            LdapContext _tdsContext = null, _cntx;
            _tdsContext = getContext();

            // Create the initial context            
            Map<String, Object> hMap = new HashMap<String, Object>();
            hMap.put("data", "dsfdfd");

            // authenticate user
            int delay = 1;
            while (true) {

                try {

                    System.out.println(" Ops started " + getName());

                    _cntx = _tdsContext.newInstance(null);                  

                    setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);

                    System.out.println(new Date()
                        + " Preferences SET "
                        + getName()
                        + " "
                        + getId()
                        + " SIZE-- "
                        + ((hMap.get("data") != null) ? hMap.get("data")
                            .toString().length() : 0));

                    _cntx.close();

                    System.out.println(" Ops conducted successfully "
                        + getName());

                } catch (NamingException e) {
                    System.out.println(new Date() + " NAMING EXCETPION"
                        + getName() + " " + getId());
                    e.printStackTrace();
                } catch (Exception ex) {
                    System.out.println(new Date() + " NAMING EXCETPION"
                        + getName() + " " + getId());
                    ex.printStackTrace();
                }

                Thread.sleep(delay);
            }
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }

    private static LdapContext getContext() {
        Hashtable<String, String> env = new Hashtable<String, String>();
        LdapContext context = null;
        String adminName = "uid=admin,ou=system";
        String adminPassword = "secret";

        env.put(Context.INITIAL_CONTEXT_FACTORY,
            "com.sun.jndi.ldap.LdapCtxFactory");
        env.put(Context.SECURITY_AUTHENTICATION, "simple");
        env.put(Context.SECURITY_PRINCIPAL, adminName);
        env.put(Context.SECURITY_CREDENTIALS, adminPassword);
        //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
        env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
        env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
            .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));

        env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
            "com.sun.jndi.ldap.connect.pool", "true"));

        try {
            context = new InitialLdapContext(env, null);
        } catch (NamingException ne) {
            System.exit(1);
        }
        return context;
    }

    public static void setUserPreferences(LdapContext context, String userName,
        Map<String, Object> attributes) throws NamingException {

        LdapContext derivedContext = context;

        String bindOp =
            TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
                + userName + "," + "dc=example,dc=com";

        try {

            try {
                // Step 1: Unbind the user preferences data
                derivedContext.unbind(bindOp);
            } catch (CommunicationException ce) {
                System.out.println("Trying to re-connect to RDS");
                //Impl reconnect logic

            } catch (NameNotFoundException nnf) {
                System.out.println("User: " + userName
                    + " cannot be found in the Ldap server");
            }

            try {
                // Step 2: Bind the user preferences data
                derivedContext.bind(bindOp, attributes);
            } catch (CommunicationException ce) {
                System.out.println("Trying to re-connect to RDS");
            } catch (NameAlreadyBoundException nab) {
                System.out.println("User: " + userName
                    + " already exists in the Ldap server");
            }

            //derivedContext.rebind(bindOp, attributes);
        } catch (NamingException ne) {
            System.out.println("Could not set user profile for user: "
                + userName);
            throw ne;
        }
    }

    /**
     * @param args
     */
    public static void main(String[] args) {
        Thread t1, t2 = null;
        for (int i = 0; i < 15; ++i) {
            t1 = new MultiThreadedTest();
            t1.start();
        }
    }

}




--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Murali Krishna  updated DIRSERVER-1369:
---------------------------------------

    Attachment: MultiThreadedTest.java

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Critical
>         Attachments: MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny updated DIRSERVER-1369:
-----------------------------------------

    Priority: Blocker  (was: Critical)

(Raised to blocker)

This has to be checked and fixed urgently before any release.

Since 1.5.4, we have fixed many issues in MINA, one of them being a huge problem with the way concurrent messages are handled (it was using a non thread safe circular list). I *hope* that this is the reason we have the misbehavior you mentioned.

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny updated DIRSERVER-1369:
-----------------------------------------

    Fix Version/s: 1.5.5

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12711749#action_12711749 ]

Bharat Gera commented on DIRSERVER-1369:
----------------------------------------

Hi,

This is a show-stopper issue to us. Can we get a patch fix on version 1.5.4? or provide us the code fix and we will make the patch.

Any help is appreciated.

Thanks

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712618#action_12712618 ]

Emmanuel Lecharny commented on DIRSERVER-1369:
----------------------------------------------

I can confirm the issue. I have tested the latest version of the server with the test, and it breaks badly when the numbe rof thread is above 3.

With 1, 2 or 3 threads, the test simply works well. As soon as we add a new thread, then we get some errors. It seems related to the number of created IoProcessor by default (3) to process incoming request. I *think* that this probelm is related to a big bug we had in MINA 2.0.0-M4, where we used non thread safe circular buffers. I have to check the server with MINA-2.0.0-M5 and with the latest branch (MINA-2.0.0-M6)

We don't have a patch available atm, but if one of the latest version of MINA fixes the problem, the patch will be quite obvious : switching the version in the pom.xml files.

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712780#action_12712780 ]

Bharat Gera commented on DIRSERVER-1369:
----------------------------------------

Please provide information if the MINA-M5 or M6 fixes the issues. Else, let us know which code base should change and we will make a patch ourselves.

When is 1.5.5. apache ds expected which is supposed to have the fix?

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712822#action_12712822 ]

Emmanuel Lecharny commented on DIRSERVER-1369:
----------------------------------------------

Ok, it's definitively a problem with MINA-2.0.0-M4. I switched to MINA 2.0.0-M5, and can't reproduce the problem using the attached test.

I will commit the modification as soon as I have run integration test.

The patch is very simple : update all the pom.xml where there is a reference to MINA-2.0.0-M4 to change it to MINA-2.0.0-M5. (there is also a solaris installer configuration file to change).

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny updated DIRSERVER-1369:
-----------------------------------------

    Attachment: MultiThreadedTest.java

Attached the working test (the original test was depending on external elements)

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java, MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny resolved DIRSERVER-1369.
------------------------------------------

    Resolution: Fixed

Fixed with :
http://svn.apache.org/viewvc?rev=778543&view=rev

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java, MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712878#action_12712878 ]

Murali Krishna  commented on DIRSERVER-1369:
--------------------------------------------

Where do we find this pom.xml and the zip version of ADS doesnot have it.
I presume we need to replace MINA libraries.
I downloaded the MINA 2.5 M5 patch libraries and what are the libraries do i need to replace or add new to the lib folder.
Can u also explain your way of generating a build.

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java, MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712895#action_12712895 ]

Emmanuel Lecharny commented on DIRSERVER-1369:
----------------------------------------------

You just have to rebuild the trunk. It's all documented on the web site :
http://directory.apache.org/apacheds/1.5/02-building-trunks.html

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java, MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712928#action_12712928 ]

Murali Krishna  commented on DIRSERVER-1369:
--------------------------------------------

I trried to build a apacheds trunk after referring to the article on it.
But my build failed with a number of compilation errors as shown


"  [INFO] Compiling 626 source files to C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\l
dap\target\classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\ldif\LdifEntry.java:[566,21] inconvertible types
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\ldif\LdifEntry.java:[618,25] inconvertible types
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\codec\add\AddRequestCodec.java:[285,29] inconvertible types
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\codec\add\AddRequestCodec.java:[392,33] inconvertible types
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientBinaryValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\codec\modify\ModifyRequestCodec.java:[355,29] inconvertible types
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\codec\modify\ModifyRequestCodec.java:[478,33] inconvertible types
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\codec\search\SearchResultEntryCodec.java:[277,33] inconvertible ty
pes
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\codec\search\SearchResultEntryCodec.java:[397,37] inconvertible ty
pes
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\entry\client\DefaultClientAttribute.java:[111,23] inconvertible ty
pes
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\entry\client\DefaultClientAttribute.java:[111,63] inconvertible ty
pes
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientBinaryValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\entry\client\DefaultClientAttribute.java:[164,13] inconvertible ty
pes
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientBinaryValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\entry\client\DefaultClientAttribute.java:[193,13] inconvertible ty
pes
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\entry\client\DefaultClientAttribute.java:[442,21] inconvertible ty
pes
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\entry\client\DefaultClientAttribute.java:[698,21] inconvertible ty
pes
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\entry\client\DefaultClientAttribute.java:[724,21] inconvertible ty
pes
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientBinaryValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\entry\client\DefaultClientAttribute.java:[1035,21] inconvertible t
ypes
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\entry\client\DefaultClientAttribute.java:[1051,21] inconvertible t
ypes
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientBinaryValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\message\CompareRequestImpl.java:[288,13] inconvertible types
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\ldif\LdifUtils.java:[484,22] inconvertible types
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientBinaryValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\ldif\LdifUtils.java:[491,22] inconvertible types
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\codec\search\AttributeValueAssertionFilter.java:[162,13] inconvert
ible types
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\codec\search\AttributeValueAssertionFilter.java:[164,81] inconvert
ible types
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientStringValue

C:\E-DRIVE\APACHE_DS_DEV\ADS_Trunk\shared\ldap\src\main\java\org\apache\director
y\shared\ldap\codec\search\AttributeValueAssertionFilter.java:[168,55] inconvert
ible types
found   : org.apache.directory.shared.ldap.entry.Value<capture of ?>
required: org.apache.directory.shared.ldap.entry.client.ClientBinaryValue
"

Do help in rebuilding the trunk.


> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java, MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712931#action_12712931 ]

Emmanuel Lecharny commented on DIRSERVER-1369:
----------------------------------------------

try running the project/resources/superclean.sh before running the build.

if you are on windows and not using cygwin, then the only option is to remove your .m2/repository file. It will take a bit longer, but should be ok.

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java, MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712934#action_12712934 ]

Murali Krishna  commented on DIRSERVER-1369:
--------------------------------------------

I still get the same errors even after cleaning and rebuilding it.
By the way, I could not find the respository folder you referred to.
I thought creating a repository is an optional task and hence skipped it soon after downloading the sources.



> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java, MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712950#action_12712950 ]

Emmanuel Lecharny commented on DIRSERVER-1369:
----------------------------------------------

find / -name ".m2" on linux
search from root on widnows.

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java, MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712958#action_12712958 ]

Murali Krishna  commented on DIRSERVER-1369:
--------------------------------------------

I was able to find repository folder and removed it.
Cleaned up and then ran the build, the build still failed with compilation errors.
I use jdk_1.5.0.7, will this cause a problem.

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java, MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712960#action_12712960 ]

Murali Krishna  commented on DIRSERVER-1369:
--------------------------------------------

I was able to find repository folder and removed it.
Cleaned up and then ran the build, the build still failed with compilation errors.
I use jdk_1.5.0.7, will this cause a problem.

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java, MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712964#action_12712964 ]

Kiran Ayyagari commented on DIRSERVER-1369:
-------------------------------------------

Is the exception same as you mentioned before in the comments?
If not some stack trace of the exception you are getting would be helpful without which it is quite difficult to guess whats happening.
Please include the type of OS and version of maven also.

> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java, MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712966#action_12712966 ]

Murali Krishna  commented on DIRSERVER-1369:
--------------------------------------------

The error messages are the same which were shown above.
I run maven-2.1.0 version on WINDOWS-XP - sun JDK 1.5.0.7


> Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.
> -----------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.4
>         Environment: Windows-xp, JDK-1.5
>            Reporter: Murali Krishna
>            Priority: Blocker
>             Fix For: 1.5.5
>
>         Attachments: MultiThreadedTest.java, MultiThreadedTest.java
>
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> This is with reference to a problem we faced when performing concurrent bind and unbind of objects with ADS-1.5.4 release build.
> Please find the java program at the bottom.
> Steps to reproduce:
> 1. Install apache_1.5.4 zip version of it and not the installer and change port numbers to 1389 and 1636 respectively.
> 2. Create a naming context ( JDBM partition) on the lines of dc=example,dc=com
> 3. Also create the entry dc=example,dc=com
> 4. Run the java program provided below.
> Actual Result:
> The console throws up numerous Naming Exceptions with message "[LDAP: error code 80 - OTHER: failed for     Del request
>         Entry : '2.5.4.3=adsadminpref_thread-11,0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=com'
> : null]; remaining name 'cn=tdsadminPref_Thread-11,dc=telelogic,dc=com' " for each thread operating on a preference object.
> As a result, the server gets into an inconsistent state and unoperational.
> Expected Result:
> The server should continuously bind and unbind the java hash table object.
> What could have caused this and how do we correct this.
> Are there any specific configurations to be made in the server.xml.
> I tried modifying some of the attributes like syncOnWrite, syncOnMillis, maxThreads, cachesize and also rebind (instead of bind and unbind) in the java program , but in vain.
> This is very important for us and do help us in this regard.
> Java program:
> import java.util.Date;
> import java.util.HashMap;
> import java.util.Hashtable;
> import java.util.Map;
> import javax.naming.CommunicationException;
> import javax.naming.Context;
> import javax.naming.NameAlreadyBoundException;
> import javax.naming.NameNotFoundException;
> import javax.naming.NamingException;
> import javax.naming.ldap.InitialLdapContext;
> import javax.naming.ldap.LdapContext;
> import com.telelogic.tds.common.TDSConstants;
> import com.telelogic.tds.common.TDSProperties;
> import com.telelogic.tds.engine.ldap.jndi.TDSDirObjectConstants;
> public class MultiThreadedTest extends Thread {
>     @Override
>     public void run() {
>         try {
>             LdapContext _tdsContext = null, _cntx;
>             _tdsContext = getContext();
>             // Create the initial context            
>             Map<String, Object> hMap = new HashMap<String, Object>();
>             hMap.put("data", "dsfdfd");
>             // authenticate user
>             int delay = 1;
>             while (true) {
>                 try {
>                     System.out.println(" Ops started " + getName());
>                     _cntx = _tdsContext.newInstance(null);                  
>                     setUserPreferences(_cntx, "adsadminPref_" + getName(), hMap);
>                     System.out.println(new Date()
>                         + " Preferences SET "
>                         + getName()
>                         + " "
>                         + getId()
>                         + " SIZE-- "
>                         + ((hMap.get("data") != null) ? hMap.get("data")
>                             .toString().length() : 0));
>                     _cntx.close();
>                     System.out.println(" Ops conducted successfully "
>                         + getName());
>                 } catch (NamingException e) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     e.printStackTrace();
>                 } catch (Exception ex) {
>                     System.out.println(new Date() + " NAMING EXCETPION"
>                         + getName() + " " + getId());
>                     ex.printStackTrace();
>                 }
>                 Thread.sleep(delay);
>             }
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
>     private static LdapContext getContext() {
>         Hashtable<String, String> env = new Hashtable<String, String>();
>         LdapContext context = null;
>         String adminName = "uid=admin,ou=system";
>         String adminPassword = "secret";
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
>             "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put(Context.SECURITY_PRINCIPAL, adminName);
>         env.put(Context.SECURITY_CREDENTIALS, adminPassword);
>         //env.put(Context.PROVIDER_URL, "ldap://10.255.0.40:389");
>         env.put(Context.PROVIDER_URL, "ldap://localhost:1389");
>         env.put(TDSConstants.JNDI_LDAP_CONNECTION_TIMEOUT, TDSProperties
>             .getProperty(TDSConstants.LDAP_CONNECTION_TIMEOUT, "2000"));
>         env.put("com.sun.jndi.ldap.connect.pool", TDSProperties.getProperty(
>             "com.sun.jndi.ldap.connect.pool", "true"));
>         try {
>             context = new InitialLdapContext(env, null);
>         } catch (NamingException ne) {
>             System.exit(1);
>         }
>         return context;
>     }
>     public static void setUserPreferences(LdapContext context, String userName,
>         Map<String, Object> attributes) throws NamingException {
>         LdapContext derivedContext = context;
>         String bindOp =
>             TDSDirObjectConstants.CN + TDSDirObjectConstants.EQUAL_SYNTAX
>                 + userName + "," + "dc=example,dc=com";
>         try {
>             try {
>                 // Step 1: Unbind the user preferences data
>                 derivedContext.unbind(bindOp);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>                 //Impl reconnect logic
>             } catch (NameNotFoundException nnf) {
>                 System.out.println("User: " + userName
>                     + " cannot be found in the Ldap server");
>             }
>             try {
>                 // Step 2: Bind the user preferences data
>                 derivedContext.bind(bindOp, attributes);
>             } catch (CommunicationException ce) {
>                 System.out.println("Trying to re-connect to RDS");
>             } catch (NameAlreadyBoundException nab) {
>                 System.out.println("User: " + userName
>                     + " already exists in the Ldap server");
>             }
>             //derivedContext.rebind(bindOp, attributes);
>         } catch (NamingException ne) {
>             System.out.println("Could not set user profile for user: "
>                 + userName);
>             throw ne;
>         }
>     }
>     /**
>      * @param args
>      */
>     public static void main(String[] args) {
>         Thread t1, t2 = null;
>         for (int i = 0; i < 15; ++i) {
>             t1 = new MultiThreadedTest();
>             t1.start();
>         }
>     }
> }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

< Prev | 1 - 2 - 3 | Next >