Skip to content

Conversation

@antiguru
Copy link
Member

@antiguru antiguru commented Jun 16, 2025

Flush container builders in exchange channels and session buffers, if they need to. This avoids a problem where we'd have a quadratic amount of lingering memory in the exchange channel. The change adds a relax function to container builders, which by default does nothing. Container builders can use it to release resources when called, and Timely calls it when it believes it's a good moment to flush. This corresponds to pushing a None value, which happens once an operator ceases to produce data.

I don't like the solution very much because it seems to conflate different concepts, but it seems like a small API change without too much negative impact.

Edit: changed the name from flush to relax for the lack of a better term.

@frankmcsherry
Copy link
Member

I think in principle a good idea, but we should discuss the name! At least, flush elsewhere (and even in the updated method) is about ensuring that any currently buffered results get shipped, where I think here it is more about deallocation. I wonder if we can find a better name (nothing leaps to mind, but e.g. chill()).

@antiguru
Copy link
Member Author

Changed the name of the function to relax, at least that's not a concept we have in Timely yet.

Copy link
Member

@frankmcsherry frankmcsherry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good in spirit, but have a few nits about the API. Mostly being clear exactly what relax should do, and making sure it does this in the one implementation.

antiguru added 4 commits June 24, 2025 15:15
Gives container builders the option to drop their allocations in flush in
exchange. Other places might benefit from this, too, but exchange has a
quadratic number of builders, so not dropping large allocations is can
cause a memory regression.

Signed-off-by: Moritz Hoffmann <[email protected]>
Signed-off-by: Moritz Hoffmann <[email protected]>
Signed-off-by: Moritz Hoffmann <[email protected]>
Signed-off-by: Moritz Hoffmann <[email protected]>
Signed-off-by: Moritz Hoffmann <[email protected]>
Copy link
Member

@frankmcsherry frankmcsherry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge once green!

Signed-off-by: Moritz Hoffmann <[email protected]>
@frankmcsherry frankmcsherry merged commit eff40d5 into TimelyDataflow:master Jun 24, 2025
8 checks passed
@antiguru antiguru deleted the exchange_flush branch June 24, 2025 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants