diff --git a/archive/control.go b/archive/control.go index 7a001654..cb5250c0 100644 --- a/archive/control.go +++ b/archive/control.go @@ -611,7 +611,7 @@ func (control *Control) PollForResponse(correlationID int64, sessionID int64) (i controlFragmentHandler(&context, buf, offset, length, header) }, aeron.DefaultFragmentAssemblyBufferLength) for { - ret := control.poll(handler.OnFragment, 10) + ret := control.poll(handler.OnFragment, 1) // Check result if control.Results.IsPollComplete { diff --git a/archive/control_test.go b/archive/control_test.go index 95fb2209..fb95fc65 100644 --- a/archive/control_test.go +++ b/archive/control_test.go @@ -62,7 +62,7 @@ func TestControl_PollForResponse(t *testing.T) { assert.EqualError(t, err, `Control Response failure: b0rk`) }) - t.Run("discards messages after error", func(t *testing.T) { // TODO: Why? + t.Run("does not process messages after result", func(t *testing.T) { control, image := newTestControl(t) mockPollResponses(t, image, &codecs.ControlResponse{ @@ -78,7 +78,7 @@ func TestControl_PollForResponse(t *testing.T) { assert.EqualValues(t, 3, id) assert.EqualError(t, err, `Control Response failure: b0rk`) fragments := image.Poll(func(buffer *atomic.Buffer, offset, length int32, header *logbuffer.Header) {}, 1) - assert.Zero(t, fragments) + assert.EqualValues(t, 1, fragments) }) }