Both the VdbSequencer (VS) and DynamicVdbSequencer (DVS) get binary values from their input property, eg.
- 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.