Skip to content

Waiting for a WaterMark might return prematurely #1345

@srh

Description

@srh

You'll note in places like waitForAppliedMark or any other code that waits for a WaterMark to be satisfied, we have for loops that begin, for n.applied.WaitingFor() {.

What that function WaitingFor() does is read an atomic variable that doesn't get set to 1 until the first Mark makes it over the channel and gets processed. Since we don't force these marks over the channel (WaterMark::Ch) to get processed, it's possible that the atomic variable has not yet been set to 1. Thus it's possible (if we imagine the mark channel never getting consumed) all watermarks return immediately.

I don't understand the purpose of WaitingFor, so there might be something here I'm missing.

Edit: There's one place that waits on WaitingFor exclusively. Looking at the history it seems the variable was not introduced with a strong intent behind what it accomplishes, so I would feel comfortable reworking it. Snce I've already made waiting for watermarks not sleep-wait I'll figure this out too.

Metadata

Metadata

Assignees

Labels

kind/bugSomething is broken.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions