You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2016/05/12 03:30:13 UTC
[jira] [Resolved] (DIRAPI-203) Calling Cursor.close() just after
the first element cause errors in log
[ https://issues.apache.org/jira/browse/DIRAPI-203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Emmanuel Lecharny resolved DIRAPI-203.
--------------------------------------
Resolution: Fixed
We now print a Warning, not an Error
> Calling Cursor.close() just after the first element cause errors in log
> -----------------------------------------------------------------------
>
> Key: DIRAPI-203
> URL: https://issues.apache.org/jira/browse/DIRAPI-203
> Project: Directory Client API
> Issue Type: Bug
> Affects Versions: 1.0.0-M21
> Reporter: Alexander Kozlov
> Priority: Trivial
> Fix For: 1.0.0-M25
>
>
> Following code example cause errors in log:
> {code}
> final SearchCursor cursor = connection.search(request);
> try
> {
> if (!cursor.next())
> return null;
> final Response response = cursor.get();
> return (response instanceof SearchResultEntry) ? ((SearchResultEntry)response).getEntry() : null;
> }
> finally
> {
> cursor.close();
> }
> {code}
> In case above, we never call _next()_ which in usual case set _SearchCursorImpl.done_ to _true_, and _Cursor.close()_ cause call of _cancel()_ and _LdapNetworkConnection.abandon()_.
> There are two different messages in log:
> 1. Most part of it is INFO message "There is no future associated with the messageI"
> {code}
> DEBUG main org.apache.directory.ldap.client.api.LdapNetworkConnection.searchAsync(LdapNetworkConnection.java:1677) - Sending request
> MessageType : SEARCH_REQUEST
> Message ID : 62
> SearchRequest
> baseDn : 'cn=test1111,ou=sipAccounts,ou=50ce9857-1f46-435c-ba5b-0e26d17552d8,dc=callcontrol,dc=com'
> filter : '(objectclass=*)'
> scope : base object
> typesOnly : false
> Size Limit : no limit
> Time Limit : no limit
> Deref Aliases : deref Always
> attributes : 'createTimestamp', 'modifyTimestamp'
> org.apache.directory.api.ldap.model.message.SearchRequestImpl@3ff0e781
> DEBUG main org.apache.directory.ldap.client.api.LdapNetworkConnection.addToFutureMap(LdapNetworkConnection.java:286) - Adding <62, org.apache.directory.ldap.client.api.future.SearchFuture>
> DEBUG NioProcessor-9 org.apache.directory.ldap.client.api.LdapNetworkConnection.messageReceived(LdapNetworkConnection.java:1860) - -------> MessageType : SEARCH_RESULT_ENTRY
> Message ID : 62
> Search Result Entry
> Entry
> dn: cn=test1111,ou=sipAccounts,ou=50ce9857-1f46-435c-ba5b-0e26d17552d8,dc=callcontrol,dc=com
> createTimestamp: 20140820172356.879Z
> modifyTimestamp: 20140820172357.046Z Message received <-------
> DEBUG NioProcessor-9 org.apache.directory.ldap.client.api.LdapNetworkConnection.peekFromFutureMap(LdapNetworkConnection.java:311) - Getting <62, org.apache.directory.ldap.client.api.future.SearchFuture>
> DEBUG NioProcessor-9 org.apache.directory.ldap.client.api.LdapNetworkConnection.messageReceived(LdapNetworkConnection.java:2152) - Search entry found : MessageType : SEARCH_RESULT_ENTRY
> Message ID : 62
> Search Result Entry
> Entry
> dn: cn=test1111,ou=sipAccounts,ou=50ce9857-1f46-435c-ba5b-0e26d17552d8,dc=callcontrol,dc=com
> createTimestamp: 20140820172356.879Z
> modifyTimestamp: 20140820172357.046Z
> DEBUG main org.apache.directory.ldap.client.api.LdapNetworkConnection.abandonInternal(LdapNetworkConnection.java:938) - Sending request
> Abandon Request :
> Message Id : 62org.apache.directory.api.ldap.model.message.AbandonRequestImpl@d6a3bc30
> DEBUG NioProcessor-9 org.apache.directory.ldap.client.api.LdapNetworkConnection.messageReceived(LdapNetworkConnection.java:1860) - -------> MessageType : SEARCH_RESULT_DONE
> Message ID : 62
> Search Result Done
> Ldap Result
> Result code : (SUCCESS) success
> Matched Dn : ''
> Diagnostic message : ''
> Message received <-------
> DEBUG main org.apache.directory.ldap.client.api.LdapNetworkConnection.getFromFutureMap(LdapNetworkConnection.java:297) - Removing <62, org.apache.directory.ldap.client.api.future.SearchFuture>
> DEBUG main org.apache.directory.ldap.client.api.LdapNetworkConnection.abandonInternal(LdapNetworkConnection.java:956) - sending cancel signal to future
> INFO NioProcessor-9 org.apache.directory.ldap.client.api.LdapNetworkConnection.messageReceived(LdapNetworkConnection.java:1871) - There is no future associated with the messageId 62, ignoring the message
> DEBUG main org.apache.directory.ldap.client.api.PoolableLdapConnectionFactory.passivateObject(PoolableLdapConnectionFactory.java:112) - Passivating org.apache.directory.ldap.client.api.LdapNetworkConnection@15ecd501
> WARN pool-4-thread-1 org.apache.directory.server.ldap.LdapSession.abandonOutstandingRequest(LdapSession.java:255) - AbandonableRequest with messageId 62 not found in outstandingRequests.
> {code}
> 2. Sometimes it cause ERROR message "There is no future associated with operation message"
> {code}
> DEBUG main org.apache.directory.ldap.client.api.LdapNetworkConnection.searchAsync(LdapNetworkConnection.java:1677) - Sending request
> MessageType : SEARCH_REQUEST
> Message ID : 25
> SearchRequest
> baseDn : 'cn=test-p1,ou=profiles,ou=50ce9857-1f46-435c-ba5b-0e26d17552d8,dc=callcontrol,dc=com'
> filter : '(objectclass=*)'
> scope : base object
> typesOnly : false
> Size Limit : no limit
> Time Limit : no limit
> Deref Aliases : deref Always
> attributes : 'createTimestamp', 'modifyTimestamp'
> org.apache.directory.api.ldap.model.message.SearchRequestImpl@864963e0
> DEBUG main org.apache.directory.ldap.client.api.LdapNetworkConnection.addToFutureMap(LdapNetworkConnection.java:286) - Adding <25, org.apache.directory.ldap.client.api.future.SearchFuture>
> DEBUG NioProcessor-9 org.apache.directory.ldap.client.api.LdapNetworkConnection.messageReceived(LdapNetworkConnection.java:1860) - -------> MessageType : SEARCH_RESULT_ENTRY
> Message ID : 25
> Search Result Entry
> Entry
> dn: cn=test-p1,ou=profiles,ou=50ce9857-1f46-435c-ba5b-0e26d17552d8,dc=callcontrol,dc=com
> createTimestamp: 20140820172356.608Z Message received <-------
> DEBUG NioProcessor-9 org.apache.directory.ldap.client.api.LdapNetworkConnection.peekFromFutureMap(LdapNetworkConnection.java:311) - Getting <25, org.apache.directory.ldap.client.api.future.SearchFuture>
> DEBUG NioProcessor-9 org.apache.directory.ldap.client.api.LdapNetworkConnection.messageReceived(LdapNetworkConnection.java:2152) - Search entry found : MessageType : SEARCH_RESULT_ENTRY
> Message ID : 25
> Search Result Entry
> Entry
> dn: cn=test-p1,ou=profiles,ou=50ce9857-1f46-435c-ba5b-0e26d17552d8,dc=callcontrol,dc=com
> createTimestamp: 20140820172356.608Z
> DEBUG NioProcessor-9 org.apache.directory.ldap.client.api.LdapNetworkConnection.messageReceived(LdapNetworkConnection.java:1860) - -------> MessageType : SEARCH_RESULT_DONE
> Message ID : 25
> Search Result Done
> Ldap Result
> Result code : (SUCCESS) success
> Matched Dn : ''
> Diagnostic message : ''
> Message received <-------
> DEBUG NioProcessor-9 org.apache.directory.ldap.client.api.LdapNetworkConnection.peekFromFutureMap(LdapNetworkConnection.java:311) - Getting <25, org.apache.directory.ldap.client.api.future.SearchFuture>
> DEBUG NioProcessor-9 org.apache.directory.ldap.client.api.LdapNetworkConnection.messageReceived(LdapNetworkConnection.java:2122) - Search successful : MessageType : SEARCH_RESULT_DONE
> Message ID : 25
> Search Result Done
> Ldap Result
> Result code : (SUCCESS) success
> Matched Dn : ''
> Diagnostic message : ''
> DEBUG main org.apache.directory.ldap.client.api.LdapNetworkConnection.abandonInternal(LdapNetworkConnection.java:938) - Sending request
> Abandon Request :
> Message Id : 25org.apache.directory.api.ldap.model.message.AbandonRequestImpl@d6a3b9bb
> DEBUG NioProcessor-9 org.apache.directory.ldap.client.api.LdapNetworkConnection.getFromFutureMap(LdapNetworkConnection.java:297) - Removing <25, org.apache.directory.ldap.client.api.future.SearchFuture>
> ERROR main org.apache.directory.ldap.client.api.LdapNetworkConnection.abandonInternal(LdapNetworkConnection.java:962) - There is no future associated with operation message ID 25, perhaps the operation would have been completed
> WARN pool-4-thread-1 org.apache.directory.server.ldap.LdapSession.abandonOutstandingRequest(LdapSession.java:255) - AbandonableRequest with messageId 25 not found in outstandingRequests.
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)