Skip to content

Commit

Permalink
Avoid discarding messages following response
Browse files Browse the repository at this point in the history
  • Loading branch information
grddev committed Mar 6, 2024
1 parent 427477a commit 0c3cd54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion archive/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions archive/control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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)
})
}

Expand Down

0 comments on commit 0c3cd54

Please sign in to comment.