Skip to content

Optionally flush container builders #668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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.

antiguru added 2 commits June 16, 2025 10:10
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]>
@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()).

Signed-off-by: Moritz Hoffmann <[email protected]>
@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.

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