Skip to content
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

feedTask not getting garbage collected #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
public class FeedContext {

public static final Comparator<FeedContext> HIGH_WATER_MARK_COMPARATOR =
(o1, o2) -> o1.highWaterMark < o2.highWaterMark ? -1 : o1.highWaterMark > o2.highWaterMark ? 1 : 0;
(o1, o2) -> {
int hwmCompare = Long.compare(o1.highWaterMark, o2.highWaterMark);

if (hwmCompare == 0) {
return Integer.compare(o1.reqId.seqNum(), o2.reqId.seqNum());
Copy link
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);
}```

}

return hwmCompare;
};

public final ReqId reqId;
public final PartitionClient sender;
Expand Down