Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-1949

Cannot add Entry to CoreSession from custom Search Interceptor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0.0-M15
    • None
    • core
    • None

    Description

      I have a custom Search Interceptor:
      private class SearchInterceptor extends BaseInterceptor

      When a use is said to be allowed to login, I basically inject the user into my cache:

      // We do not actually inject it, we give it to the JIT write-through
      // cache which will inject it only once, then delete after a timeout.
      
      //private final JitLdapWritethroughCache _jitLdapCache
      _jitLdapCache.insert(entryUser);
      

      Which basically does:

      // private DirectoryService service;
      service.getAdminSession().add(e);
      

      The line "service.getAdminSession().add(e);" basically locks up my thread (won't respond to my search request) and won't allow any other request to go through.

      If I look at the stack, it blocks at the following line (line 390 - DefaultOperationManager)

      // Call the Add method
      Interceptor head = directoryService.getInterceptor( addContext.getNextInterceptor() );
      
      lockWrite();
      

      and

          public void lockWrite()
          {
              rwLock.writeLock().lock();
          }
      

      This code all ran on the "Thread [pool-4-thread-1]" thread.

      Before running "service.getAdminSession().add(e)" I ran:

      Trace.info(service.getOperationManager().getRWLock().toString());
      

      Which outputted:

      5398 [main] INFO com.rbccm.authhelper.ldap.ServerRunner  - [testinstanceid] java.util.concurrent.locks.ReentrantReadWriteLock@7177600e[Write locks = 0, Read locks = 0]
      

      Thank you for your help.

      Attachments

        1. Interceptors.jpg
          77 kB
          Pierre-Luc Lacroix

        Activity

          People

            Unassigned Unassigned
            pll.lacroix Pierre-Luc Lacroix
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: