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

Fix #7116, skip the insertion of the same continuation to pending dns #7117

Merged
merged 1 commit into from
Aug 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions iocore/hostdb/HostDB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,10 @@ HostDBContinuation::set_check_pending_dns()
{
Queue<HostDBContinuation> &q = hostDB.pending_dns_for_hash(hash.hash);
this->setThreadAffinity(this_ethread());
if (q.in(this)) {
Warning("Skip the insertion of the same continuation to pending dns");
return false;
}
HostDBContinuation *c = q.head;
for (; c; c = static_cast<HostDBContinuation *>(c->link.next)) {
masaori335 marked this conversation as resolved.
Show resolved Hide resolved
if (hash.hash == c->hash.hash) {
Copy link
Member

@oknet oknet Aug 18, 2020

Choose a reason for hiding this comment

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

The hash.hash == c->hash.hash must be true if c is this. Please try q.in_or_enqueue(this).

Copy link
Member Author

Choose a reason for hiding this comment

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

@oknet you suggested using in_or_enqueue(), however, if the continuation is not in the list, we need to check the hash matched or not. I guess the latest version of using in() works well.

Expand Down