private void AwaitRecordingComplete( long recordingId, long completePosition, CountersReader counters, int counterId, AeronArchive archive) { idleStrategy.Reset(); do { idleStrategy.Idle(); CheckInterruptedStatus(); if (!RecordingPos.IsActive(counters, counterId, recordingId)) { throw new InvalidOperationException("recording has stopped unexpectedly: " + recordingId); } archive.CheckForErrorResponse(); } while (counters.GetCounterValue(counterId) < completePosition); }