Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2464

VdbSequencer and VdbDynamicSequencer fails to close input streams

    Details

      Description

      Both the VdbSequencer (VS) and DynamicVdbSequencer (DVS) get binary values from their input property, eg.

      final Binary binaryValue = inputProperty.getBinary();
      
      • The VS creates a ZipInputStream from the binaryValue - this is closed upon completion;
      • The DVS creates an InputStream - this is NOT closed upon completion.
      • The new stream is passed into VdbSequencer.readManifest();
      • The stream is then passed into VdbManifest.read();
      • VdbManifest has its own reader and the stream is passed into Reader.read();
      • Reader.read() opens an XMLStreamReader instance but this is NOT closed upon completion;

      The creation of the XMLStreamReader creates a NamedLock on the original binaryValue of the inputProperty. Since the XMLStreamReader is not closed, this lock is never cleared.

      The saving of a session also creates the same named NamedLock and since one already exists and is locking the binaryValue, deadlock occurs and Modeshape hangs.

      This has been observed in unit tests where

      • the Vdb Sequencer is executed;
      • a different session clears the repository (hence modifying the binaryValue property);
      • the clear-session is saved.

      Hopefully, PR to follow with fix, closing the sequencer streams.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                hchiorean Horia Chiorean
                Reporter:
                phantomjinx Paul Richardson
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: