Derby
  1. Derby
  2. DERBY-3992

cleanupOnError does not log the original exception if it encounters an error on cleanup

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 10.5.1.1
    • Fix Version/s: None
    • Component/s: Services
    • Urgency:
      Normal
    • Issue & fix info:
      High Value Fix

      Description

      Recently I encountered a couple of cases where we encountered an error on cleanupOnError so the original exception that caused the cleanup action was lost. It would be useful if the exception passed to cleanupOnError was logged regardless of whether there was a subsequent exception on cleanup.

      Here are a couple sample traces. The first was from a user site.
      ----------------------------------------------------------------
      New exception raised during cleanup null
      java.lang.NullPointerException
      at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)
      at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.flush(Unknown Source)
      at org.apache.derby.impl.store.raw.data.CachedPage.writePage(Unknown Source)
      at org.apache.derby.impl.store.raw.data.CachedPage.clean(Unknown Source)
      at org.apache.derby.impl.services.cache.CachedItem.clean(Unknown Source)
      at org.apache.derby.impl.services.cache.Clock.cleanCache(Unknown Source)
      at org.apache.derby.impl.services.cache.Clock.cleanAll(Unknown Source)
      at org.apache.derby.impl.services.cache.Clock.shutdown(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.stop(Unknown Source)
      at org.apache.derby.impl.services.monitor.TopService.stop(Unknown Source)
      at org.apache.derby.impl.services.monitor.TopService.shutdown(Unknown Source)
      at org.apache.derby.impl.services.monitor.BaseMonitor.shutdown(Unknown Source)
      at org.apache.derby.impl.db.DatabaseContextImpl.cleanupOnError(Unknown Source)
      at org.apache.derby.iapi.services.context.ContextManager.cleanupOnError(Unknown Source)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.cleanupOnError(Unknown Source)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
      at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown Source)
      at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
      at java.sql.DriverManager.getConnection(DriverManager.java:562)
      at java.sql.DriverManager.getConnection(DriverManager.java:186)

      The second was from a run on IBM 1.6 of store/encryptDatabaseTest1.sql.
      I can't reproduce the error.
      New exception raised during cleanup name can't be null
      java.lang.NullPointerException: name can't be null
      at java.io.FilePermission.init(FilePermission.java:183)
      at java.io.FilePermission.<init>(FilePermission.java:267)
      at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
      at java.io.File.list(File.java:983)
      at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(BaseDataFileFactory.java:2640)
      at java.security.AccessController.doPrivileged(AccessController.java:251)
      at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.removeStubs(BaseDataFileFactory.java:1591)
      at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.stop(BaseDataFileFactory.java:499)
      at org.apache.derby.impl.services.monitor.TopService.stop(TopService.java:405)
      at org.apache.derby.impl.services.monitor.TopService.shutdown(TopService.java:349)
      at org.apache.derby.impl.services.monitor.BaseMonitor.shutdown(BaseMonitor.java:239)
      at org.apache.derby.impl.db.DatabaseContextImpl.cleanupOnError(DatabaseContextImpl.java:60)
      at org.apache.derby.iapi.services.context.ContextManager.cleanupOnError(ContextManager.java:332)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.cleanupOnError(TransactionResourceImpl.java:419)
      at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:584)
      at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:68)
      at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:238)
      at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:119)
      at java.sql.DriverManager.getConnection(DriverManager.java:316)
      at java.sql.DriverManager.getConnection(DriverManager.java:297)
      at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1329)
      at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:1179)
      at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:1007)
      at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:328)
      at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:248)
      at org.apache.derby.impl.tools.ij.Main.go(Main.java:215)
      at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:181)
      at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
      at org.apache.derby.tools.ij.main(ij.java:59)

      In both cases it would have been useful to have the original exception

        Activity

        Kathey Marsden created issue -
        Kathey Marsden made changes -
        Field Original Value New Value
        Derby Categories [High Value Fix]
        Kathey Marsden made changes -
        Assignee Kathey Marsden [ kmarsden ]
        Myrna van Lunteren made changes -
        Affects Version/s 10.5.1.1 [ 12313771 ]
        Affects Version/s 10.5.0.0 [ 12313010 ]
        Kathey Marsden made changes -
        Assignee Kathey Marsden [ kmarsden ]
        Dag H. Wanvik made changes -
        Issue & fix info [High Value Fix]
        Knut Anders Hatlen made changes -
        Urgency Normal
        Kathey Marsden made changes -
        Labels derby_triage10_5_2
        Mamta A. Satoor made changes -
        Attachment DERBY3992_patch1_diff.txt [ 12561037 ]
        Kathey Marsden made changes -
        Labels derby_triage10_5_2 derby_triage10_11
        Gavin made changes -
        Workflow jira [ 12448540 ] Default workflow, editable Closed status [ 12802579 ]
        Mamta A. Satoor made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Cannot Reproduce [ 5 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Kathey Marsden
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development