Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-151

Thread termination -> XSDG after operation is 'complete'



    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Store
    • None
    • Linux kernel 2.4.21-243-athlon (SuSE 9.0)
    • High Value Fix, Repro attached
    • Seen in production


      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?



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

        Issue Links



              dagw Dag H. Wanvik
              bd49 Barnet Wagman
              5 Vote for this issue
              7 Start watching this issue