|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 - 3 | Next > |
|
|
[jira] Commented: (DIRSERVER-1369) Concurrent bind and unbind of objects puts ADS in an inconsistent (unusable) state.[ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12724647#action_12724647 ] Bharat Gera commented on DIRSERVER-1369: ---------------------------------------- Hi - The status if this tracker is yet open? When will the fix be available in a nightly build or so? There is a comment that the fix is trivial. We need to make a release of apache and this bug scares me on the impacts. Can you please confirm the occurence of this bug - - Does it only occur if multiple add/delete operations are performed on the same object? - What if concurrent write operations are done on different objects? If (2) is not an issue; I may yet be in a better position. > 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, 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.[ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12724664#action_12724664 ] Emmanuel Lecharny commented on DIRSERVER-1369: ---------------------------------------------- Just some update beside what you can find in DIRSEVER-1377 : - the issue is far from trivial, as I initially thought. I'm on it since last week, and still not seing a clear fix for it. The problem occurs now after 500 000 operations (but this is an average, it can occur before). That mean I had to check gigabytes of logs. We have also identified some side errors, being fixed since then. Otherwise, the area where the issue occurs has been identified, and we are suspecting some bug in the AVLTree implementation we have. This is what we currently are analysing. I hope that we can come with a fix by newt monday. In any case, this is absolutely priority number one for us, right now. > 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, 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.[ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12726061#action_12726061 ] Bharat Gera commented on DIRSERVER-1369: ---------------------------------------- Any update on this? > 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, 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.[ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12727488#action_12727488 ] Emmanuel Lecharny commented on DIRSERVER-1369: ---------------------------------------------- Nope. We post updates to DIRSERVER-1377, when available. Still working on it, as of today (July, 6th ...) > 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, 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.[ 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 as DIRSERVER-1377 has been fixed. Feel free to reopen the issue if the current trunk does not satisfies your tests > 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, 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.[ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12732909#action_12732909 ] Bharat Gera commented on DIRSERVER-1369: ---------------------------------------- Ok. Thanks. We will keep you updated on our test results. > 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, 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 > |
| Free embeddable forum powered by Nabble | Forum Help |