Skip to content

Commit

Permalink
better check for EOF
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
  • Loading branch information
shlomi-noach committed Jan 1, 2025
1 parent a3aa3a0 commit 2729850
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package vreplication

import (
"context"
"errors"
"io"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -116,13 +117,6 @@ func (p *parallelWorkersPool) drain(ctx context.Context) (err error) {
return vterrors.Wrapf(err, "drain aborted")
}
}
// p.mu.Lock()
// defer p.mu.Unlock()
//
// p.head = 0
// for i := range p.workers {
// p.recycleWorker(p.workers[i])
// }
return p.workersError()
}

Expand Down Expand Up @@ -155,7 +149,7 @@ func (p *parallelWorkersPool) availableWorker(ctx context.Context, lastCommitted

go func() {
if err := w.applyQueuedEvents(ctx); err != nil {
if err == io.EOF {
if errors.Is(vterrors.UnwrapAll(err), io.EOF) {
w.pool.posReached.Store(true)
}
p.workerErrors <- err
Expand Down

0 comments on commit 2729850

Please sign in to comment.