Uploaded image for project: 'FtpServer'
  1. FtpServer
  2. FTPSERVER-214

DbUserManager seems to improperly cache a database connection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 1.0.0-M3
    • 1.0.0-M3
    • Core
    • None
    • Java6 SLES, Windows

    Description

      We have configured the FTP server with a org.apache.commons.dbcp.BasicDataSource datasource and MySQL (com.mysql.jdbc.Driver) driver.

      It appears that either the commons datasource idles/closes the connection, or MySQL does, however the DbUserManager keeps a reference to the connection (see cachedConnection).

      Should we let the datasource do that – and remove any sort of cached connection.

      java.io.EOFException
      at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1913)
      at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2304)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2803)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:3047)
      at com.mysql.jdbc.Statement.executeQuery(Statement.java:1166)
      at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
      at org.apache.ftpserver.usermanager.DbUserManager.getUserByName(DbUserManager.java:519)
      at org.apache.ftpserver.command.USER.execute(USER.java:139)
      at org.apache.ftpserver.DefaultFtpHandler.messageReceived(DefaultFtpHandler.java:138)
      at org.apache.ftpserver.listener.nio.FtpHandlerAdapter.messageReceived(FtpHandlerAdapter.java:60)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:752)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:414)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:49)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:832)
      at org.apache.ftpserver.filter.FtpLoggingFilter.messageReceived(FtpLoggingFilter.java:81)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:414)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:49)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:832)
      at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:60)
      at org.apache.mina.filter.logging.MdcInjectionFilter.filter(MdcInjectionFilter.java:137)
      at org.apache.mina.filter.util.CommonEventFilter.messageReceived(CommonEventFilter.java:70)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:414)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:49)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:832)
      at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:379)
      at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:173)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:414)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:49)
      at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:832)
      at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:60)
      at org.apache.mina.core.session.IoEvent.run(IoEvent.java:64)
      at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:551)
      at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:543)
      at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:487)
      at java.lang.Thread.run(Thread.java:619)

      Attachments

        Activity

          People

            niklas Niklas Therning
            randy@fixflyer.com Randy Prager
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: