Derby
  1. Derby
  2. DERBY-4985

BootLockTest can fail with ERROR XCY03: Required property 'derby.serviceProtocol' has not been set with slow configurations

    Details

    • Issue & fix info:
      Newcomer, Repro attached
    • Bug behavior facts:
      Regression Test Failure

      Description

      If derby tests are running with JVM options that slow things down substantially, it can fail with:
      1) testBootLock(org.apache.derbyTesting.functionTests.tests.store.BootLockTest)j
      unit.framework.ComparisonFailure: Dual boot not detected: check BootLockMinion.l
      og expected:<...SDB6> but was:<...CY03>
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDB
      CTestCase.java:769)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDB
      CTestCase.java:804)
      at org.apache.derbyTesting.functionTests.tests.store.BootLockTest.testBo
      otLock(BootLockTest.java:145)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:60)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:37)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:
      109)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      at junit.extensions.TestSetup.run(TestSetup.java:23)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57
      )
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      at junit.extensions.TestSetup.run(TestSetup.java:23)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      at junit.extensions.TestSetup.run(TestSetup.java:23)
      Caused by: java.sql.SQLException: Required property 'derby.serviceProtocol' has
      not been set.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLE
      xceptionFactory40.java:95)
      at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:256)

      at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnecti
      on.java:2723)
      at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.jav
      a:384)
      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:
      128)
      at java.sql.DriverManager.getConnection(DriverManager.java:322)
      at java.sql.DriverManager.getConnection(DriverManager.java:297)
      at org.apache.derbyTesting.junit.DriverManagerConnector.openConnection(D
      riverManagerConnector.java:81)
      at org.apache.derbyTesting.junit.DriverManagerConnector.openConnection(D
      riverManagerConnector.java:43)
      at org.apache.derbyTesting.junit.TestConfiguration.openDefaultConnection
      (TestConfiguration.java:1538)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.openDefaultConnection(
      BaseJDBCTestCase.java:428)
      at org.apache.derbyTesting.junit.BaseJDBCTestCase.getConnection(BaseJDBC
      TestCase.java:110)
      at org.apache.derbyTesting.functionTests.tests.store.BootLockTest.testBo
      otLock(BootLockTest.java:136)
      ... 31 more
      Caused by: java.sql.SQLException: Required property 'derby.serviceProtocol' has
      not been set.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExc
      eptionFactory.java:45)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransport
      AcrossDRDA(SQLExceptionFactory40.java:119)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLE
      xceptionFactory40.java:70)
      ... 45 more
      Caused by: ERROR XCY03: Required property 'derby.serviceProtocol' has not been s
      et.
      at org.apache.derby.iapi.error.StandardException.newException(StandardEx
      ception.java:286)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderServi
      ce(BaseMonitor.java:1679)
      at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndSta
      rtService(BaseMonitor.java:1560)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentSer
      vice(BaseMonitor.java:979)
      at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService
      (Monitor.java:550)
      at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnecti
      on.java:2686)
      ... 43 more

      The test waits for the spawned process to create db.lck and service.properties and then waits three seconds more to make sure the properties have been written, but this might not be enough time.
      Although I have not seen this myself with unchanged code , I can simulate it on windows by changing StorageFactoryService.saveServiceProperties() to have a sleep between creating the service.properties file and writing the properties out, e.g.

      try
      {
      os = servicePropertiesFile.getOutputStream();
      try

      { Thread.sleep(10000); }

      catch (Exception e) {}
      properties.store( os, serviceName + MessageService.getTextMessage(MessageId.SERVICE_PROPERTIES_DONT_EDIT));

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        21h 15m 1 Kathey Marsden 26/Jan/11 22:42
        Resolved Resolved Closed Closed
        872d 10h 37m 1 Knut Anders Hatlen 17/Jun/13 10:19
        Gavin made changes -
        Workflow jira [ 12543659 ] Default workflow, editable Closed status [ 12802872 ]
        Knut Anders Hatlen made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Knut Anders Hatlen added a comment -

        [bulk update] Close all resolved issues that haven't been updated for more than one year.

        Show
        Knut Anders Hatlen added a comment - [bulk update] Close all resolved issues that haven't been updated for more than one year.
        Rick Hillegas made changes -
        Fix Version/s 10.8.1.2 [ 12316362 ]
        Fix Version/s 10.8.1.1 [ 12316356 ]
        Rick Hillegas made changes -
        Fix Version/s 10.8.1.1 [ 12316356 ]
        Fix Version/s 10.8.1.0 [ 12315561 ]
        Kathey Marsden made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Issue & fix info [Repro attached, Patch Available, Newcomer] [Newcomer, Repro attached]
        Fix Version/s 10.5.3.1 [ 12314182 ]
        Fix Version/s 10.6.2.3 [ 12315434 ]
        Fix Version/s 10.7.1.3 [ 12315902 ]
        Fix Version/s 10.8.0.0 [ 12315561 ]
        Resolution Fixed [ 1 ]
        Kathey Marsden made changes -
        Issue & fix info [Repro attached, Newcomer] [Newcomer, Patch Available, Repro attached]
        Hide
        Kathey Marsden added a comment -

        I'll run store._Suite and then check in.

        Show
        Kathey Marsden added a comment - I'll run store._Suite and then check in.
        Kathey Marsden made changes -
        Field Original Value New Value
        Attachment derby-4985_diff.txt [ 12469450 ]
        Hide
        Kathey Marsden added a comment -

        Here is a patch for this issue. BootLockMinion creates a file after it has made the connection and created a table that BootLockTest can check for, so we are really sure that the database creation and connection are complete.

        Show
        Kathey Marsden added a comment - Here is a patch for this issue. BootLockMinion creates a file after it has made the connection and created a table that BootLockTest can check for, so we are really sure that the database creation and connection are complete.
        Kathey Marsden created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development