Skip to content

feedTask not getting garbage collected#178

Open
patrickghannage wants to merge 1 commit into
masterfrom
fix-feed-task-high-watermark-comparator
Open

feedTask not getting garbage collected#178
patrickghannage wants to merge 1 commit into
masterfrom
fix-feed-task-high-watermark-comparator

Conversation

@patrickghannage
Copy link
Copy Markdown
Contributor

When no append requests are happening on a certain partition, feed contexts may accumulate on the real time feed task queue of that partition server in case of a disconnection between a Waltz client and the server holding that partition.

@hrdlotom hrdlotom self-requested a review April 3, 2023 14:45
int hwmCompare = Long.compare(o1.highWaterMark, o2.highWaterMark);

if (hwmCompare == 0) {
return Integer.compare(o1.reqId.seqNum(), o2.reqId.seqNum());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's say we have FeedContexts of equal HWM. The first feed context is still going to block the queue while waiting for a new transaction. At this point the FeedContext becomes inactive but is still blocking the queue that may be dangerously grow. This doesn't critically influence the functionality of Waltz as with new transaction old expired FeedContexts are all erased and active FeedContexts are served.

Partition.FeedTask.process:

if (highWaterMark < nextTransactionId) {
     // Wait for more data or new feed context
    feedSync.await(version);
}```

@hrdlotom hrdlotom self-requested a review April 3, 2023 17:12
Copy link
Copy Markdown
Collaborator

@hrdlotom hrdlotom left a comment

Choose a reason for hiding this comment

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

LGTM. Expired feed contexts will be poped out when new feed context is inserted.

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