… at Red5/red5-server#154 (comment) .
ns.close() in the client triggers the RecordingListner.stop() which triggers a second processQueue() loop. One might already exist because EventQueueJob triggers a processQueue() every 3 seconds and scheduler.removeScheduledJob(eventQueueJobName) somehow does not remove an existing one. EventQueueJob is initialized in RecordingListner.start(). Each processQueue() leads to a pushMessage() in FileCosumer.java which can trigger a write with writeQueuedDataSlice(...) if the packet is of video type. 2 processQueue loops can lead to simultaneous writeQueuedDataSlice() .