|
View:
New views
20 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=12712972#action_12712972 ] Emmanuel Lecharny commented on DIRSERVER-1369: ---------------------------------------------- You most certainly have an old version of some libs somewhere on you disk. Check out the project somewhere else, remove the .m2 repo again, and build again. > 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.[ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714837#action_12714837 ] Sumit Goyal commented on DIRSERVER-1369: ---------------------------------------- Hi Emmanuel I tried to compile the project on my machine: compilation went through but it failed while testing and got following error : Results : Failed tests: testSaslGssapiBind(org.apache.directory.server.kerberos.kdc.SaslGssapiBindITes t) testForwardedTicket(org.apache.directory.server.kerberos.protocol.TicketGranti ngPolicyTest) Tests in error: testSpecificStartTime(org.apache.directory.server.kerberos.protocol.TicketGran tingServiceTest) Tests run: 105, Failures: 2, Errors: 1, Skipped: 0 [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] There are test failures. Please refer to C:\Documents and Settings\Administrator\apacheds-trunk\apacheds\ protocol-kerberos\target\surefire-reports for the individual test results. [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 19 minutes 5 seconds [INFO] Finished at: Fri May 29 19:51:25 IST 2009 [INFO] Final Memory: 48M/63M [INFO] ------------------------------------------------------------------------ C:\Documents and Settings\Administrator\apacheds-trunk> The individual test log files, did not have much information about the error. On my second try for recompiling, I hit the same error reported by Murali above. I deleted the .m2 file, tried to build in some other location, still the same error. Pasting the error log below: C:\Documents and Settings\Administrator\Desktop\ads\apacheds-trunk\shared\ldap\ rc\main\java\org\apache\directory\shared\ldap\entry\client\DefaultClientAttribu e.java:[442,21] inconvertible types found : org.apache.directory.shared.ldap.entry.Value<capture of ?> required: org.apache.directory.shared.ldap.entry.client.ClientStringValue C:\Documents and Settings\Administrator\Desktop\ads\apacheds-trunk\shared\ldap\ rc\main\java\org\apache\directory\shared\ldap\entry\client\DefaultClientAttribu e.java:[698,21] inconvertible types found : org.apache.directory.shared.ldap.entry.Value<capture of ?> required: org.apache.directory.shared.ldap.entry.client.ClientStringValue C:\Documents and Settings\Administrator\Desktop\ads\apacheds-trunk\shared\ldap\ rc\main\java\org\apache\directory\shared\ldap\entry\client\DefaultClientAttribu e.java:[724,21] inconvertible types found : org.apache.directory.shared.ldap.entry.Value<capture of ?> required: org.apache.directory.shared.ldap.entry.client.ClientBinaryValue C:\Documents and Settings\Administrator\Desktop\ads\apacheds-trunk\shared\ldap\ rc\main\java\org\apache\directory\shared\ldap\entry\client\DefaultClientAttribu e.java:[1035,21] inconvertible types found : org.apache.directory.shared.ldap.entry.Value<capture of ?> required: org.apache.directory.shared.ldap.entry.client.ClientStringValue C:\Documents and Settings\Administrator\Desktop\ads\apacheds-trunk\shared\ldap\ rc\main\java\org\apache\directory\shared\ldap\entry\client\DefaultClientAttribu e.java:[1051,21] inconvertible types found : org.apache.directory.shared.ldap.entry.Value<capture of ?> required: org.apache.directory.shared.ldap.entry.client.ClientBinaryValue C:\Documents and Settings\Administrator\Desktop\ads\apacheds-trunk\shared\ldap\ rc\main\java\org\apache\directory\shared\ldap\message\CompareRequestImpl.java:[ 88,13] inconvertible types found : org.apache.directory.shared.ldap.entry.Value<capture of ?> required: org.apache.directory.shared.ldap.entry.client.ClientStringValue [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 53 seconds [INFO] Finished at: Sun May 31 09:27:10 IST 2009 [INFO] Final Memory: 36M/108M [INFO] ------------------------------------------------------------------------ C:\Documents and Settings\Administrator\Desktop\ads\apacheds-trunk> Can we request you to make the project libraries for us and upload on some central repository pls? Many Thanks Sumit > 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.[ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714838#action_12714838 ] Emmanuel Lecharny commented on DIRSERVER-1369: ---------------------------------------------- We are using a continuous build system. if there was some issue with the source, we would be informed immediately. Also we are careful enough to do a full build *before* commiting code on trunk so that other developpers don't have issue with compilation. So far, I have asked someone else to check that the last trunk version was compiling ok. Of course, this is on Linux, which may be a bit different than on windows, but as far as I can tell, I rebuild the full server last friday on windows, without any problem. If you are using a slow windows machine however, you may have some time issues during the unit tests for some specific part of the code (probably because we assume that we are running the tests on a fast enough machine in order to avoid introducing waits in time dependent tests). In any case, we really don't have time not storage to produce nighty builds atm. This is something we want to do at some point, but not before july. Last, not least, i'm really sorry, but I don't have a windows machine available :/ I use a linux box, and a mac occasionally... You can ask the ML if someone is kind enough to build this windows binaries... > 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.[ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714839#action_12714839 ] Emmanuel Lecharny commented on DIRSERVER-1369: ---------------------------------------------- I can also add that we are working hard to get a 1.5.5 out really soon (probably in the next couple of weeks). It's all a matter of having a MINA 2.0.0-M6 out - will be done by tonite -, conduct some minimal perf tests and fix a couple of critical issues, plus a vote and 5 days to cut the release. > 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] Reopened: (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 ] Bharat Gera reopened DIRSERVER-1369: ------------------------------------ I have to reopen the issue until things are resolved. We can wait for 2-3 weeks if we are to get apache 1.5.5? or please provide the binaries of the required libraries in 2-3 weeks. We will close the issue once we get the fix in any form. > 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] Closed: (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 closed DIRSERVER-1369. ---------------------------------------- Resolution: Fixed The initial issue has already been fixed in trunk.If you have another problem, create another JIRA, with all the needed informations to prove that there is a real issue. > 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.[ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714910#action_12714910 ] Sumit Goyal commented on DIRSERVER-1369: ---------------------------------------- I started the build process on another *faster* windows machine i have. After two failures, I was finally able to build the apacheds successfully. Both failure were due to OOM, first i changed only 'JAVA_OPTS' en. var, but 'MAVEN_OPTS' helped. Needed to set XmX to 384M, to make the build process complete.(It was taking 64M by default) I am going through the folder structure generated, will post an update here about my final 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 > > 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=12714912#action_12714912 ] Emmanuel Lecharny commented on DIRSERVER-1369: ---------------------------------------------- I have updated the wiki accordingly, in the 'developer guide' (http://directory.apache.org/apacheds/1.5/02-building-trunks.html). It will be refreshed in a few hours. > 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.[ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714918#action_12714918 ] Sumit Goyal commented on DIRSERVER-1369: ---------------------------------------- HI Emmanuel Thanks a lot for your quick responses!! This issue is very critical for us, that's why we wanted a fix as soon as possible. I hope with this fix now, we will be able to proceed. I was able to find 'apacheds-1.5.5-SNAPSHOT.zip'. at the path apacheds-trunk\installers\apacheds\target\images. (One correction for our wiki: it states that snapshot file will be present as apacheds-1.5.?SNAPSHOT<XXXXXX>-setup.jar, which is not true in my case, am I doing anything wrong? in my whole dir structure, there is no such file :( ) I am now starting the original failing tests just to check if our issue has been solved. Will post my results here. Thanks! Sumit > 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.[ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718392#action_12718392 ] Murali Krishna commented on DIRSERVER-1369: -------------------------------------------- Hi, I have some queries on using C-library SDK against ADS 1.5.4. 1. Does apache provide its own C-SDK for ldap programming? 2. If not, what if we use SDK's of Tivoli or Mozilla or Sunone. How easy is the process of integration or porting.Is it a seamless activity? 3. Finally, what about the support for VLV controls, paging. I heard that 1.5.5 does have support for VLV .When can we expect an official stable release build of 1.5.5. Regards, Murali > 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.[ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718528#action_12718528 ] Bharat Gera commented on DIRSERVER-1369: ---------------------------------------- Murali - You may need to open a new ticket. That will be the correct approach to get the feedback. -bharat > 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.[ https://issues.apache.org/jira/browse/DIRSERVER-1369?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718537#action_12718537 ] Emmanuel Lecharny commented on DIRSERVER-1369: ---------------------------------------------- Bharat is right. This ticket is closed, there is almost no chance we give it a chance to get an answer. Also I don't really think it deserves a new ticket : it probably fits better the user's mailing list. > 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] Reopened: (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 ] Sumit Goyal reopened DIRSERVER-1369: ------------------------------------ Hi Emmanuel We were able to make the 1.5.5 server up and running. The problem reported initially still exists. We modified the program written by you. Earlier the loop (doing unbind and bind operations) was run 100 times per thread. We changed it to run forever. This causes the same error, which came around 2300th operation for all threads. Adding one of the exception stack traces we got: ERROR - 2322javax.naming.NamingException: [LDAP: error code 80 - OTHER: failed for Del request Entry : '2.5.4.3=adsadminpref_worker-thread0,2.5.4.11=system' : Error during underflow [3]]; remaining name 'cn=adsadminPref_Worker-Thread0,ou=system' at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source) at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source) at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source) at com.sun.jndi.ldap.LdapCtx.c_unbind(Unknown Source) at com.sun.jndi.toolkit.ctx.ComponentContext.p_unbind(Unknown Source) at com.sun.jndi.toolkit.ctx.PartialCompositeContext.unbind(Unknown Source) at com.sun.jndi.toolkit.ctx.PartialCompositeContext.unbind(Unknown Source) at Emmanuel.setUserPreferences(Emmanuel.java:150) at Emmanuel.run(Emmanuel.java:67) Please look into the issue. Will upload the test program used by us. pls let us know if you need any other information from us. > 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] Issue Comment Edited: (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=12720051#action_12720051 ] Sumit Goyal edited comment on DIRSERVER-1369 at 6/16/09 3:40 AM: ----------------------------------------------------------------- Added the test program used by us to recreate the issue. was (Author: sumgoyal): The test program used by us to recreate the issue. > 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] Updated: (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 ] Sumit Goyal updated DIRSERVER-1369: ----------------------------------- Attachment: MultiThreadedTest.java The test program used by us to recreate the issue. > 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=12720268#action_12720268 ] Emmanuel Lecharny commented on DIRSERVER-1369: ---------------------------------------------- I confirm the problem... Not only we have some exception after a while, but then the server database seems to be broken. I'm investigating the issue. > 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=12720391#action_12720391 ] Emmanuel Lecharny commented on DIRSERVER-1369: ---------------------------------------------- After a bit (!) of investigation, the problem seems to be different. The error I get show that we are trying to store a huge number of elements in the same JDBM page, up to a point we replace the page with a BTree. We might have concurrency issues here. (?) Also what is strange is that values are supposed to be removed, so the page size should be constant. Another aspect I have to dig ... Won't be easy to fix anyway ! Thanks for the test, btw, it really helps ! > 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=12721292#action_12721292 ] Emmanuel Lecharny commented on DIRSERVER-1369: ---------------------------------------------- Ok, we have probably found the origin of the problem. First, we have found a first big bug : The sublevel index was growing without limit (DIRSERVER-1376). Second, we have a concurrent access to the index we have to fix : https://issues.apache.org/jira/browse/DIRSERVER-1377 Hopefully, this could be easy to 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, 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=12721342#action_12721342 ] Bharat Gera commented on DIRSERVER-1369: ---------------------------------------- I will like to get input on the overall Apache DS stability for concurrent access. The issue almost blocked us to release our product. We had made workarounds in the application. Is there information available on the usage of Apache DS like , - Concurrent Access scenarios that is the fundamental operation to any database. Ofcoure , there is no transactional support in ldap but I find it strange that a product in v1.5 has such basic issues? - Overall stability of Apache in production deployment with less than 10,000 users with multiple applications connecting? We plan to release apache DS big time next year across multiple product integrations and the stability of the product really concerns me. Any docs, links etc will help. > 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=12721345#action_12721345 ] Emmanuel Lecharny commented on DIRSERVER-1369: ---------------------------------------------- The current bug we havs has been introduced after 1.5.3, when we refactored the way we handle index. This is not a surprise that we have bugs. It's a surprise though that it took so long to appear. One reason is that a LDAP server is first of all used for reads. In this very case, the problem is quite simple to solve. Otherwise, it's an open source project, so you are on your own. > 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 |