There's a race between Add()ing to the WaitGroup and then Wait()ing for it; it's possible that we close(r.done) and Wait(); then Wait() just returns immediately
If we immediately call Update() after newConcurrentFetchers, then lastReturnedRecord might stay as -1. So we'd resume from offset -1 🥴 instead of from the start or end of the partition
after Update() we should continue from lastReturnedRecord+1 because we've already fetched and returned lastReturnedRecord; this isn't critical though
This is missing tests; WIP
Which issue(s) this PR fixes or relates to
Fixes #
Checklist
[ ] Tests updated.
[ ] Documentation added.
[ ] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
What this PR does
fixes
Add()
ing to theWaitGroup
and thenWait()
ing for it; it's possible that weclose(r.done)
andWait()
; thenWait()
just returns immediatelyUpdate()
afternewConcurrentFetchers
, thenlastReturnedRecord
might stay as -1. So we'd resume from offset -1 🥴 instead of from the start or end of the partitionUpdate()
we should continue fromlastReturnedRecord+1
because we've already fetched and returnedlastReturnedRecord
; this isn't critical thoughThis is missing tests; WIP
Which issue(s) this PR fixes or relates to
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.