[GH-ISSUE #1607] [trust-dns-client] SyncClient::send() with TCP returns 5 seconds after response is received #709

Open
opened 2026-03-15 23:54:59 +03:00 by kerem · 1 comment
Owner

Originally created by @chenxiaolong on GitHub (Dec 16, 2021).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1607

Describe the bug

When using a SyncClient with TcpClientConnection, sending a query via client.query() results in a response near instantaneously, but sending the same (manually constructed) query via client.send() results in a 5 second delay. Looking a tcpdump, I can see the response being returned after several milliseconds, but client.send() doesn't return until 5 seconds later. This does not happen with UDP connections.

To Reproduce

I created a small executable example here: https://gist.github.com/chenxiaolong/584bbd699cc834ba7e4c586b59d610a2

When I run it, I get:

TCP:
client.query() duration: 18.987ms
client.send() duration: 5.020749s
UDP:
client.query() duration: 10.0079ms
client.send() duration: 9.7753ms

Expected behavior

client.send() should return as soon as it has the response, similar to client.query(), client.update(), etc.

System:

  • OS: Windows
  • Architecture: x86_64
  • Version 10 (21H1)
  • rustc version: 1.57.0

Version:
Crate: client
Version: 0.21.0-alpha.4

Additional context

(I used query as an example because it's simpler, but in my actual project, I'm actually sending DNS updates (RFC 2136) and hit the same delay with client.send() for those messages.)

Originally created by @chenxiaolong on GitHub (Dec 16, 2021). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1607 **Describe the bug** When using a `SyncClient` with `TcpClientConnection`, sending a query via `client.query()` results in a response near instantaneously, but sending the same (manually constructed) query via `client.send()` results in a 5 second delay. Looking a `tcpdump`, I can see the response being returned after several milliseconds, but `client.send()` doesn't return until 5 seconds later. This does not happen with UDP connections. **To Reproduce** I created a small executable example here: https://gist.github.com/chenxiaolong/584bbd699cc834ba7e4c586b59d610a2 When I run it, I get: ``` TCP: client.query() duration: 18.987ms client.send() duration: 5.020749s UDP: client.query() duration: 10.0079ms client.send() duration: 9.7753ms ``` **Expected behavior** `client.send()` should return as soon as it has the response, similar to `client.query()`, `client.update()`, etc. **System:** - OS: Windows - Architecture: x86_64 - Version 10 (21H1) - rustc version: 1.57.0 **Version:** Crate: client Version: 0.21.0-alpha.4 **Additional context** (I used `query` as an example because it's simpler, but in my actual project, I'm actually sending DNS updates (RFC 2136) and hit the same delay with `client.send()` for those messages.)
Author
Owner

@bluejekyll commented on GitHub (Dec 20, 2021):

Hm that’s awkward. I have seen an odd hang in one of the tests, but I haven’t looked into it. I wonder if it could be related. It sounds like for some reason the timeout is being waited on inappropriately, will be interesting to look into. With the holidays I might not have time to look myself for a little bit.

<!-- gh-comment-id:997601751 --> @bluejekyll commented on GitHub (Dec 20, 2021): Hm that’s awkward. I have seen an odd hang in one of the tests, but I haven’t looked into it. I wonder if it could be related. It sounds like for some reason the timeout is being waited on inappropriately, will be interesting to look into. With the holidays I might not have time to look myself for a little bit.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#709
No description provided.