RI 1.2 is not proceeding with the recording even though the free space is available in the MSV
I have created an MSV of size 15MB. Started a recording of duration 5 minutes on the MSV. I have stopped the recording by using LeafRecordingRequest.stop() API after 34 seconds. Still the MSV has free space of 47%. Waited for 1 second. Then started new recording on the same service with duration just 5 seconds. This recording goes to IN_PROGRESS_INSUFFICIENT_STATE and then immediately transitions to IN_PROGRESS_WITH_ERROR_STATE with reason SPACE_FULL. After the stop spec has been called, transitioned to FAILED_STATE.
The MSV has 47% of it's space free. It should accomodate the recording, and the recording should be in COMPLETED_STATE after the it is completed.
When the first recording starts, a new TSB and a new recording file will be created whose initial sizes are 0. While TSB conversion is going on, the callback method for TSB conversion is checking for the condition "required space to append the current chunk of recording content should be less than available space". Here the required space is being calculated by subtracting the recording file size from TSB size. (required space = TSB size - current recording file size). This works fine for the first recording.
When we start the second recording it will use the same TSB again whose initial size is not zero and creates new recording file (size 0). Now in the callback method the requred space (TSB size - current recording file size) is greater than the free space available in the MSV because of huge TSB size (The delta will be huge). So the recording goes to IN_PROGRESS_WITH_ERROR_STATE with reason SPACE_FULL. Actually, the MSV is capable of accomodating the complete new recording but due to this calculation the recording is failing.
This is observed in both RI 1.2 and RI 1.1.4. Can anyone clarify me on this whether it is an issue or expected?