James Server
  1. James Server
  2. JAMES-294

Database Pool becomes exhausted after a short time when heavily polled

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.0
    • Labels:
      None
    • Environment:
      Windows NT v4.0, Java 1.4.2

      Description

      I've had RC3 running for the past week.

      Other than an issue I ran into with the config.xml when translating changes from my 0a4 configuration, RC3 has been running quite well except for a new problem that appears to have surfaced.

      This issue may relate to the fact that I've also been evaluating Mars
      (http://leapfrog-mars.sourceforge.net/) for monitoring services.

      Here's the exception that's occurring in the pop3server log:

      23/05/04 11:01:58 ERROR pop3server: Exception during connection from intfar.com (66.92.129.218) : An exception occurred getting a database connection.
      org.apache.avalon.framework.CascadingRuntimeException: An exception occurred getting a database connection.
      at
      org.apache.james.userrepository.AbstractJdbcUsersRepository.openConnection(A
      bstractJdbcUsersRepository.java:601)
      at
      org.apache.james.userrepository.AbstractJdbcUsersRepository.getUserByName(Ab
      stractJdbcUsersRepository.java:506)
      at
      org.apache.james.userrepository.AbstractUsersRepository.test(AbstractUsersRe
      pository.java:284)
      at
      org.apache.james.pop3server.POP3Handler.doPASS(POP3Handler.java:528)
      at
      org.apache.james.pop3server.POP3Handler.parseCommand(POP3Handler.java:470)
      at
      org.apache.james.pop3server.POP3Handler.handleConnection(POP3Handler.java:26
      6)
      at
      org.apache.james.util.connection.ServerConnection$ClientConnectionRunner.run
      (ServerConnection.java:417)
      at
      org.apache.james.util.thread.ExecutableRunnable.execute(ExecutableRunnable.j
      ava:55)
      at
      org.apache.james.util.thread.WorkerThread.run(WorkerThread.java:90)
      Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted, cause: Timeout waiting for idle object
      at
      org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja
      va:148)
      at
      org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:5
      18)
      at
      org.apache.james.util.dbcp.JdbcDataSource.getConnection(JdbcDataSource.java:
      218)
      at
      org.apache.james.userrepository.AbstractJdbcUsersRepository.openConnection(A
      bstractJdbcUsersRepository.java:598)
      ... 8 more
      Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
      at
      org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPoo
      l.java:801)
      at
      org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja
      va:140)
      ... 11 more

      This an exception from mailstore log:

      23/05/04 10:31:09 ERROR mailstore: Error retrieving messageCannot get a connection, pool exhausted0nullnull
      23/05/04 10:31:09 ERROR mailstore: Exception during retrieve – skipping item Mail1085326264738-657
      javax.mail.MessagingException: Exception while retrieving mail: Cannot get a connection, pool exhausted
      at
      org.apache.james.mailrepository.JDBCMailRepository.retrieve(JDBCMailReposito
      ry.java:905)
      at
      org.apache.james.mailrepository.JDBCSpoolRepository.accept(JDBCSpoolReposito
      ry.java:199)
      at
      org.apache.james.mailrepository.JDBCSpoolRepository.accept(JDBCSpoolReposito
      ry.java:124)
      at
      org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:350)
      at java.lang.Thread.run(Thread.java:536)

      Some background:

      I am the primary user of this mail server. My M$ Outlook checks 5 different accounts every 5 minutes.

      Since I've been evaluating Mars, I've had it monitoring access for POP3 and SMTP every minute, with a 5 second timeout.

      I think it's this last point that's likely causing the problem. Am I expecting too much from James? My monitoring too aggressive?

      As this seems to be a new issue, I didn't think RC4 was likely to solve it.

        Activity

        Hide
        Chris Means added a comment -

        I now believe this problem to be related to a buggy mailet. I've not yet had the time to deal with it, but as I'm the only one who seems to be experiencing this problem, it seems likely that it is tied closely to my particular configuration.

        I no longer consider this to be a bug in James. Please close it.

        Show
        Chris Means added a comment - I now believe this problem to be related to a buggy mailet. I've not yet had the time to deal with it, but as I'm the only one who seems to be experiencing this problem, it seems likely that it is tied closely to my particular configuration. I no longer consider this to be a bug in James. Please close it.
        Hide
        Chris Means added a comment -

        The update for DBCP didn't fix the problem.

        The exceptions started again a few minutes ago. I did not restart the service after terminating the additional monitoring...just left it running.

        I have restarted it, and turned on DEBUG for: spoolmanager, pop3server, smtpserver, and mailstore.

        Hopefully we'll have more info the next time it dies.

        Anything else I should check?

        Show
        Chris Means added a comment - The update for DBCP didn't fix the problem. The exceptions started again a few minutes ago. I did not restart the service after terminating the additional monitoring...just left it running. I have restarted it, and turned on DEBUG for: spoolmanager, pop3server, smtpserver, and mailstore. Hopefully we'll have more info the next time it dies. Anything else I should check?
        Hide
        Noel J. Bergman added a comment -

        DBCP 1.2 release candidates added to 2.2.0RC5. No code changes expected. DBCP release expected to occur within the next week.

        Show
        Noel J. Bergman added a comment - DBCP 1.2 release candidates added to 2.2.0RC5. No code changes expected. DBCP release expected to occur within the next week.
        Hide
        Chris Means added a comment -

        Following a pointer from Noel, I updated my James.SAR with new release candidates for commons-dbcp and commons-pool available at:

        http://jakarta.apache.org/commons/pool/downloads.html
        http://jakarta.apache.org/commons/dbcp/downloads.html

        I also punched up the polling time for my Mars monitor to every 10 seconds for both SMTP and POP3. I left it running for over 24 hours without the exceptions reoccuring.

        I've now turned off the extra polling, and am watching to see if the exceptions reoccur during a normal load, but so far, the updated jars seem to have resolved the issues.

        Show
        Chris Means added a comment - Following a pointer from Noel, I updated my James.SAR with new release candidates for commons-dbcp and commons-pool available at: http://jakarta.apache.org/commons/pool/downloads.html http://jakarta.apache.org/commons/dbcp/downloads.html I also punched up the polling time for my Mars monitor to every 10 seconds for both SMTP and POP3. I left it running for over 24 hours without the exceptions reoccuring. I've now turned off the extra polling, and am watching to see if the exceptions reoccur during a normal load, but so far, the updated jars seem to have resolved the issues.

          People

          • Assignee:
            Noel J. Bergman
            Reporter:
            Chris Means
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development