Derby
  1. Derby
  2. DERBY-151

Thread termination -> XSDG after operation is 'complete'

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.2.1
    • Fix Version/s: 10.6.1.0
    • Component/s: Store
    • Labels:
      None
    • Environment:
      Linux kernel 2.4.21-243-athlon (SuSE 9.0)
    • Issue & fix info:
      High Value Fix, Repro attached
    • Bug behavior facts:
      Seen in production

      Description

      I've encountered what appears to be a bug related to threading. After an INSERT operation, if the invoking thread terminates too quickly, Derby throws an XSDG.

      The bug is a bit difficult to isolate but it occurs consistently in the following situation (with a particular database and an operation of a particular size):

      Derby is running in embedded mode with autocommit on.
      The application performs an INPUT operation from a thread that is not the main thread. The INPUT is issued using a PreparedStatement. The INPUT adds ~ 256 records of six fields each. (Note that INSERTs of this size seem to work fine in other contexts.)

      The preparedStatement.executeUpdate() seems to excute successfully; at least it returns without throwing an exception.

      The thread that invoked the INPUT operation then terminates (but NOT the application). The next INPUT operation then results in an

      "ERROR XSDG1: Page Page(7,Container(0, 1344)) could not be written to disk, please check if disk is full."

      The disk is definitely not full.

      HOWEVER, if I put the calling thread to sleep for a second before it exits, the problem does not occur.

      I'm not quite sure what to make of this. I was under the impression that most of Derby's activity occurs in the application's threads. Could Derby be creating a child thread from in the application thread, which dies when the parent thread terminates?

      Thanks

      1. Derby151Test.java
        2 kB
        Paul Sabatino
      2. derby-151-followup.diff
        5 kB
        Dag H. Wanvik
      3. derby-151-c.stat
        0.5 kB
        Dag H. Wanvik
      4. derby-151-c.diff
        14 kB
        Dag H. Wanvik
      5. derby-151-b.stat
        0.5 kB
        Dag H. Wanvik
      6. derby-151-b.diff
        14 kB
        Dag H. Wanvik
      7. derby-151-a.stat
        0.4 kB
        Dag H. Wanvik
      8. derby-151-a.diff
        9 kB
        Dag H. Wanvik
      9. derby.log
        67 kB
        Jörg von Frantzius
      10. d151.java
        0.6 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Barnet Wagman created issue -
          Mike Matrigali made changes -
          Field Original Value New Value
          Component/s Store [ 11412 ]
          Description I've encountered what appears to be a bug related to threading. After an INSERT operation, if the invoking thread terminates too quickly, Derby throws an XSDG.

          The bug is a bit difficult to isolate but it occurs consistently in the following situation (with a particular database and an operation of a particular size):

          Derby is running in embedded mode with autocommit on.
          The application performs an INPUT operation from a thread that is not the main thread. The INPUT is issued using a PreparedStatement. The INPUT adds ~ 256 records of six fields each. (Note that INSERTs of this size seem to work fine in other contexts.)
           
          The preparedStatement.executeUpdate() seems to excute successfully; at least it returns without throwing an exception.

          The thread that invoked the INPUT operation then terminates (but NOT the application). The next INPUT operation then results in an

          "ERROR XSDG1: Page Page(7,Container(0, 1344)) could not be written to disk, please check if disk is full."

          The disk is definitely not full.

          HOWEVER, if I put the calling thread to sleep for a second before it exits, the problem does not occur.

          I'm not quite sure what to make of this. I was under the impression that most of Derby's activity occurs in the application's threads. Could Derby be creating a child thread from in the application thread, which dies when the parent thread terminates?

          Thanks



          I've encountered what appears to be a bug related to threading. After an INSERT operation, if the invoking thread terminates too quickly, Derby throws an XSDG.

          The bug is a bit difficult to isolate but it occurs consistently in the following situation (with a particular database and an operation of a particular size):

          Derby is running in embedded mode with autocommit on.
          The application performs an INPUT operation from a thread that is not the main thread. The INPUT is issued using a PreparedStatement. The INPUT adds ~ 256 records of six fields each. (Note that INSERTs of this size seem to work fine in other contexts.)
           
          The preparedStatement.executeUpdate() seems to excute successfully; at least it returns without throwing an exception.

          The thread that invoked the INPUT operation then terminates (but NOT the application). The next INPUT operation then results in an

          "ERROR XSDG1: Page Page(7,Container(0, 1344)) could not be written to disk, please check if disk is full."

          The disk is definitely not full.

          HOWEVER, if I put the calling thread to sleep for a second before it exits, the problem does not occur.

          I'm not quite sure what to make of this. I was under the impression that most of Derby's activity occurs in the application's threads. Could Derby be creating a child thread from in the application thread, which dies when the parent thread terminates?

          Thanks



          Jörg von Frantzius made changes -
          Attachment .log [ 12314344 ]
          Jörg von Frantzius made changes -
          Attachment derby.log [ 12314345 ]
          Andrew McIntyre made changes -
          Attachment .log [ 12314344 ]
          Knut Anders Hatlen made changes -
          Attachment d151.java [ 12374906 ]
          Paul Sabatino made changes -
          Attachment Derby151Test.java [ 12375515 ]
          Kathey Marsden made changes -
          Derby Categories [High Value Fix]
          Dag H. Wanvik made changes -
          Issue & fix info [High Value Fix]
          Myrna van Lunteren made changes -
          Bug behavior facts [Seen in production]
          Issue & fix info [High Value Fix] [High Value Fix, Repro attached]
          Dag H. Wanvik made changes -
          Comment [ I will be out of the office on leave from Friday, 14th of August and
          will be back, Monday 24th August. For support-related queries, please
          email support@nuix.com.

          Cheers,
          David

          --
          Cheers,
          David

          Nuix Pty Ltd
          Suite 79, 89 Jones St, Ultimo NSW 2007, Australia Ph: +61 2 9280 0699
          Web: http://www.nuix.com Fax: +61 2 9212 6902
          ]
          Dag H. Wanvik made changes -
          Attachment derby-151-a.diff [ 12417374 ]
          Attachment derby-151-a.stat [ 12417375 ]
          Dag H. Wanvik made changes -
          Issue & fix info [Repro attached, High Value Fix] [High Value Fix, Patch Available, Repro attached]
          Dag H. Wanvik made changes -
          Attachment derby-151-a.diff [ 12417374 ]
          Dag H. Wanvik made changes -
          Attachment derby-151-a.stat [ 12417375 ]
          Dag H. Wanvik made changes -
          Attachment derby-151-a.diff [ 12417376 ]
          Attachment derby-151-a.stat [ 12417377 ]
          Dag H. Wanvik made changes -
          Attachment derby-151-b.diff [ 12418184 ]
          Attachment derby-151-b.stat [ 12418185 ]
          Dag H. Wanvik made changes -
          Assignee Dag H. Wanvik [ dagw ]
          Dag H. Wanvik made changes -
          Attachment derby-151-b.diff [ 12418184 ]
          Dag H. Wanvik made changes -
          Attachment derby-151-b.diff [ 12418186 ]
          Dag H. Wanvik made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Dag H. Wanvik made changes -
          Attachment derby-151-c.diff [ 12426724 ]
          Attachment derby-151-c.stat [ 12426725 ]
          Dag H. Wanvik made changes -
          Attachment derby-151-c.diff [ 12426724 ]
          Dag H. Wanvik made changes -
          Attachment derby-151-c.stat [ 12426725 ]
          Dag H. Wanvik made changes -
          Attachment derby-151-c.diff [ 12426729 ]
          Attachment derby-151-c.stat [ 12426730 ]
          Dag H. Wanvik made changes -
          Attachment derby-151-followup.diff [ 12426822 ]
          Dag H. Wanvik made changes -
          Attachment derby-151-followup.diff [ 12426822 ]
          Dag H. Wanvik made changes -
          Attachment derby-151-followup.diff [ 12426825 ]
          Dag H. Wanvik made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Issue & fix info [Repro attached, Patch Available, High Value Fix] [High Value Fix, Repro attached]
          Fix Version/s 10.6.0.0 [ 12313727 ]
          Resolution Fixed [ 1 ]
          Dag H. Wanvik made changes -
          Link This issue relates to DERBY-4461 [ DERBY-4461 ]
          Knut Anders Hatlen made changes -
          Link This issue is related to DERBY-4463 [ DERBY-4463 ]
          Kathey Marsden made changes -
          Link This issue relates to DERBY-4481 [ DERBY-4481 ]
          Dag H. Wanvik made changes -
          Link This issue relates to DERBY-4741 [ DERBY-4741 ]
          Knut Anders Hatlen made changes -
          Link This issue is related to DERBY-4813 [ DERBY-4813 ]
          Kathey Marsden made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Workflow jira [ 40286 ] Default workflow, editable Closed status [ 12801277 ]

            People

            • Assignee:
              Dag H. Wanvik
              Reporter:
              Barnet Wagman
            • Votes:
              5 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development