[GH-ISSUE #137] Panic when running query on SyncClient #363

Closed
opened 2026-03-15 22:09:19 +03:00 by kerem · 8 comments
Owner

Originally created by @opensourcegeek on GitHub (May 25, 2017).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/137

I'm using trust_dns as a client to resolve names on 2 interfaces I have (just like dig @local_interface boo.com), I get a panic on the thread which I guess is because it cannot connect to a DNS server. Just trying to understand how to correctly query using trust_dns.

let (tx, rx) = mpsc::channel();
for addr in all_net_addrs {
        let tx_clone = tx.clone();
        let t = thread::spawn(move || {
            println!("DNS resolver trying on {:?}", addr.ip());
            let socket = SocketAddr::new(addr.ip(), 53);
            let connection = UdpClientConnection::new(socket);
            match connection {
                Ok(c) => {
                    let client = SyncClient::new(c);
                    let res = client.query(&Name::new()
                                            .label("google")
                                            .label("co")
                                            .label("uk"), 
                                            DNSClass::IN, RecordType::A);
                    
                    match res {
                        Ok(r) => {
                            println!("{:?}", r);
                            println!("{:?}", r.response_code());
                            match r.response_code() {
                                ResponseCode::NoError => {
                                    let ip_add = &r.answers()[0];
                                    println!("{:?}", ip_add);
                                    tx_clone.send(ip_add.clone());
                                },
                                _ => {
                                    println!("Warning! Failed to resolve");
                                }
                            }
                        },
                        Err(e) => {
                            println!("{:?}", e);
                        }
                    }
                },
                Err(e) => {
                    println!("{:?}", e);
                }
            }
        });

        t.join();

        let resp = rx.recv_timeout(time::Duration::from_secs(30));     
}
Error(Timeout, (None, stack backtrace:
   0:     0x563f1e6b89b1 - backtrace::backtrace::libunwind::trace
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/libunwind.rs:54
                         - backtrace::backtrace::trace<closure>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/mod.rs:70
   1:     0x563f1e6b9803 - backtrace::capture::{{impl}}::new
                        at /home/opensourcegeek/projects/rust-playground/bq-collector/target/debug/build/backtrace-811cded9ab5b8ade/out/capture.rs:79
   2:     0x563f1e60800b - trust_dns::error::client_error::{{impl}}::from
                        at /home/opensourcegeek/projects/rust-playground/bq-collector/<error_chain macros>:39
   3:     0x563f1e221767 - core::convert::{{impl}}::into<trust_dns::error::client_error::ErrorKind,trust_dns::error::client_error::Error>
                        at /checkout/src/libcore/convert.rs:279
   4:     0x563f1e268b04 - trust_dns::client::client_future::{{impl}}::drop_cancelled<trust_dns::udp::udp_client_stream::UdpClientStream>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client_future.rs:158
   5:     0x563f1e2ddb0c - trust_dns::client::client_future::{{impl}}::poll<trust_dns::udp::udp_client_stream::UdpClientStream>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client_future.rs:186
   6:     0x563f1e269b37 - futures::future::chain::{{impl}}::poll<futures::future::map::Map<alloc::boxed::Box<Future>, closure>,trust_dns::client::client_future::ClientFuture<trust_dns::udp::udp_client_stream::UdpClientStream>,(),closure>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/future/chain.rs:32
   7:     0x563f1e2be99b - futures::future::flatten::{{impl}}::poll<futures::future::map::Map<alloc::boxed::Box<Future>, closure>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/future/flatten.rs:44
   8:     0x563f1e2cca26 - futures::future::map_err::{{impl}}::poll<(),futures::future::flatten::Flatten<futures::future::map::Map<alloc::boxed::Box<Future>, closure>>,closure>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/future/map_err.rs:30
   9:     0x563f1e659a01 - futures::future::{{impl}}::poll<Future>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/future/mod.rs:106
  10:     0x563f1e646d2c - futures::task_impl::{{impl}}::poll_future::{{closure}}<alloc::boxed::Box<Future>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/task_impl/mod.rs:337
  11:     0x563f1e64719e - futures::task_impl::{{impl}}::enter::{{closure}}<alloc::boxed::Box<Future>,closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/task_impl/mod.rs:484
  12:     0x563f1e65af73 - futures::task_impl::set::{{closure}}<closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/task_impl/mod.rs:61
  13:     0x563f1e6486c7 - std::thread::local::{{impl}}::with<core::cell::Cell<*const futures::task_impl::BorrowedTask>,closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /checkout/src/libstd/thread/local.rs:253
  14:     0x563f1e65adff - futures::task_impl::set<closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/task_impl/mod.rs:54
  15:     0x563f1e646f0e - futures::task_impl::{{impl}}::enter<alloc::boxed::Box<Future>,closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/task_impl/mod.rs:484
  16:     0x563f1e646cb7 - futures::task_impl::{{impl}}::poll_future<alloc::boxed::Box<Future>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/task_impl/mod.rs:337
  17:     0x563f1e665312 - tokio_core::reactor::{{impl}}::dispatch_task::{{closure}}
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.6/src/reactor/mod.rs:366
  18:     0x563f1e643474 - scoped_tls::{{impl}}::set<tokio_core::reactor::Core,closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.0/src/lib.rs:135
  19:     0x563f1e664e58 - tokio_core::reactor::{{impl}}::dispatch_task
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.6/src/reactor/mod.rs:366
  20:     0x563f1e6643a5 - tokio_core::reactor::{{impl}}::dispatch
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.6/src/reactor/mod.rs:324
  21:     0x563f1e663f0b - tokio_core::reactor::{{impl}}::poll
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.6/src/reactor/mod.rs:312
  22:     0x563f1e136294 - tokio_core::reactor::{{impl}}::run<alloc::boxed::Box<Future>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.6/src/reactor/mod.rs:249
  23:     0x563f1e2e11e3 - trust_dns::client::client::Client::query<trust_dns::client::client::SyncClient,trust_dns::client::client_future::BasicClientHandle>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client.rs:61
  24:     0x563f1e30c822 - bq_collector::ccu_dns_checker::run_dns_checks::{{closure}}
                        at /home/opensourcegeek/projects/rust-playground/bq-collector/src/ccu_dns_checker.rs:36
  25:     0x563f1e2c97b6 - std::panic::{{impl}}::call_once<(),closure>
                        at /checkout/src/libstd/panic.rs:296
  26:     0x563f1e18c2fa - std::panicking::try::do_call<std::panic::AssertUnwindSafe<closure>,()>
                        at /checkout/src/libstd/panicking.rs:454
  27:     0x563f1e96122a - panic_unwind::__rust_maybe_catch_panic
                        at /checkout/src/libpanic_unwind/lib.rs:98
  28:     0x563f1e18bd84 - std::panicking::try<(),std::panic::AssertUnwindSafe<closure>>
                        at /checkout/src/libstd/panicking.rs:433
  29:     0x563f1e182c37 - std::panic::catch_unwind<std::panic::AssertUnwindSafe<closure>,()>
                        at /checkout/src/libstd/panic.rs:361
  30:     0x563f1e18ab2a - std::thread::{{impl}}::spawn::{{closure}}<closure,()>
                        at /checkout/src/libstd/thread/mod.rs:360
  31:     0x563f1e220c6e - alloc::boxed::{{impl}}::call_box<(),closure>
                        at /checkout/src/liballoc/boxed.rs:640
  32:     0x563f1e958f04 - alloc::boxed::{{impl}}::call_once<(),()>
                        at /checkout/src/liballoc/boxed.rs:650
                         - std::sys_common::thread::start_thread
                        at /checkout/src/libstd/sys_common/thread.rs:21
                         - std::sys::imp::thread::{{impl}}::new::thread_start
                        at /checkout/src/libstd/sys/unix/thread.rs:84
  33:     0x7f31c1f36554 - start_thread
  34:     0x7f31c1a59dec - __clone
  35:                0x0 - <unknown>))

Originally created by @opensourcegeek on GitHub (May 25, 2017). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/137 I'm using trust_dns as a client to resolve names on 2 interfaces I have (just like `dig @local_interface boo.com`), I get a panic on the thread which I guess is because it cannot connect to a DNS server. Just trying to understand how to correctly query using trust_dns. ```rust let (tx, rx) = mpsc::channel(); for addr in all_net_addrs { let tx_clone = tx.clone(); let t = thread::spawn(move || { println!("DNS resolver trying on {:?}", addr.ip()); let socket = SocketAddr::new(addr.ip(), 53); let connection = UdpClientConnection::new(socket); match connection { Ok(c) => { let client = SyncClient::new(c); let res = client.query(&Name::new() .label("google") .label("co") .label("uk"), DNSClass::IN, RecordType::A); match res { Ok(r) => { println!("{:?}", r); println!("{:?}", r.response_code()); match r.response_code() { ResponseCode::NoError => { let ip_add = &r.answers()[0]; println!("{:?}", ip_add); tx_clone.send(ip_add.clone()); }, _ => { println!("Warning! Failed to resolve"); } } }, Err(e) => { println!("{:?}", e); } } }, Err(e) => { println!("{:?}", e); } } }); t.join(); let resp = rx.recv_timeout(time::Duration::from_secs(30)); } ``` ``` Error(Timeout, (None, stack backtrace: 0: 0x563f1e6b89b1 - backtrace::backtrace::libunwind::trace at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/libunwind.rs:54 - backtrace::backtrace::trace<closure> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/mod.rs:70 1: 0x563f1e6b9803 - backtrace::capture::{{impl}}::new at /home/opensourcegeek/projects/rust-playground/bq-collector/target/debug/build/backtrace-811cded9ab5b8ade/out/capture.rs:79 2: 0x563f1e60800b - trust_dns::error::client_error::{{impl}}::from at /home/opensourcegeek/projects/rust-playground/bq-collector/<error_chain macros>:39 3: 0x563f1e221767 - core::convert::{{impl}}::into<trust_dns::error::client_error::ErrorKind,trust_dns::error::client_error::Error> at /checkout/src/libcore/convert.rs:279 4: 0x563f1e268b04 - trust_dns::client::client_future::{{impl}}::drop_cancelled<trust_dns::udp::udp_client_stream::UdpClientStream> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client_future.rs:158 5: 0x563f1e2ddb0c - trust_dns::client::client_future::{{impl}}::poll<trust_dns::udp::udp_client_stream::UdpClientStream> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client_future.rs:186 6: 0x563f1e269b37 - futures::future::chain::{{impl}}::poll<futures::future::map::Map<alloc::boxed::Box<Future>, closure>,trust_dns::client::client_future::ClientFuture<trust_dns::udp::udp_client_stream::UdpClientStream>,(),closure> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/future/chain.rs:32 7: 0x563f1e2be99b - futures::future::flatten::{{impl}}::poll<futures::future::map::Map<alloc::boxed::Box<Future>, closure>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/future/flatten.rs:44 8: 0x563f1e2cca26 - futures::future::map_err::{{impl}}::poll<(),futures::future::flatten::Flatten<futures::future::map::Map<alloc::boxed::Box<Future>, closure>>,closure> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/future/map_err.rs:30 9: 0x563f1e659a01 - futures::future::{{impl}}::poll<Future> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/future/mod.rs:106 10: 0x563f1e646d2c - futures::task_impl::{{impl}}::poll_future::{{closure}}<alloc::boxed::Box<Future>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/task_impl/mod.rs:337 11: 0x563f1e64719e - futures::task_impl::{{impl}}::enter::{{closure}}<alloc::boxed::Box<Future>,closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/task_impl/mod.rs:484 12: 0x563f1e65af73 - futures::task_impl::set::{{closure}}<closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/task_impl/mod.rs:61 13: 0x563f1e6486c7 - std::thread::local::{{impl}}::with<core::cell::Cell<*const futures::task_impl::BorrowedTask>,closure,core::result::Result<futures::poll::Async<()>, ()>> at /checkout/src/libstd/thread/local.rs:253 14: 0x563f1e65adff - futures::task_impl::set<closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/task_impl/mod.rs:54 15: 0x563f1e646f0e - futures::task_impl::{{impl}}::enter<alloc::boxed::Box<Future>,closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/task_impl/mod.rs:484 16: 0x563f1e646cb7 - futures::task_impl::{{impl}}::poll_future<alloc::boxed::Box<Future>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.11/src/task_impl/mod.rs:337 17: 0x563f1e665312 - tokio_core::reactor::{{impl}}::dispatch_task::{{closure}} at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.6/src/reactor/mod.rs:366 18: 0x563f1e643474 - scoped_tls::{{impl}}::set<tokio_core::reactor::Core,closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.0/src/lib.rs:135 19: 0x563f1e664e58 - tokio_core::reactor::{{impl}}::dispatch_task at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.6/src/reactor/mod.rs:366 20: 0x563f1e6643a5 - tokio_core::reactor::{{impl}}::dispatch at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.6/src/reactor/mod.rs:324 21: 0x563f1e663f0b - tokio_core::reactor::{{impl}}::poll at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.6/src/reactor/mod.rs:312 22: 0x563f1e136294 - tokio_core::reactor::{{impl}}::run<alloc::boxed::Box<Future>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.6/src/reactor/mod.rs:249 23: 0x563f1e2e11e3 - trust_dns::client::client::Client::query<trust_dns::client::client::SyncClient,trust_dns::client::client_future::BasicClientHandle> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client.rs:61 24: 0x563f1e30c822 - bq_collector::ccu_dns_checker::run_dns_checks::{{closure}} at /home/opensourcegeek/projects/rust-playground/bq-collector/src/ccu_dns_checker.rs:36 25: 0x563f1e2c97b6 - std::panic::{{impl}}::call_once<(),closure> at /checkout/src/libstd/panic.rs:296 26: 0x563f1e18c2fa - std::panicking::try::do_call<std::panic::AssertUnwindSafe<closure>,()> at /checkout/src/libstd/panicking.rs:454 27: 0x563f1e96122a - panic_unwind::__rust_maybe_catch_panic at /checkout/src/libpanic_unwind/lib.rs:98 28: 0x563f1e18bd84 - std::panicking::try<(),std::panic::AssertUnwindSafe<closure>> at /checkout/src/libstd/panicking.rs:433 29: 0x563f1e182c37 - std::panic::catch_unwind<std::panic::AssertUnwindSafe<closure>,()> at /checkout/src/libstd/panic.rs:361 30: 0x563f1e18ab2a - std::thread::{{impl}}::spawn::{{closure}}<closure,()> at /checkout/src/libstd/thread/mod.rs:360 31: 0x563f1e220c6e - alloc::boxed::{{impl}}::call_box<(),closure> at /checkout/src/liballoc/boxed.rs:640 32: 0x563f1e958f04 - alloc::boxed::{{impl}}::call_once<(),()> at /checkout/src/liballoc/boxed.rs:650 - std::sys_common::thread::start_thread at /checkout/src/libstd/sys_common/thread.rs:21 - std::sys::imp::thread::{{impl}}::new::thread_start at /checkout/src/libstd/sys/unix/thread.rs:84 33: 0x7f31c1f36554 - start_thread 34: 0x7f31c1a59dec - __clone 35: 0x0 - <unknown>)) ```
kerem closed this issue 2026-03-15 22:09:24 +03:00
Author
Owner

@bluejekyll commented on GitHub (May 26, 2017):

I will look at this more in depth later, but the expected socketaddr for constructing the connection is the remote dns server/resolver address, not the local host. I'm not sure which you're using there...

<!-- gh-comment-id:304159713 --> @bluejekyll commented on GitHub (May 26, 2017): I will look at this more in depth later, but the expected socketaddr for constructing the connection is the remote dns server/resolver address, not the local host. I'm not sure which you're using there...
Author
Owner

@opensourcegeek commented on GitHub (May 26, 2017):

I've a slightly complex setup. There is a local dns server (which forwards to another dns server) and the idea is to check if I can resolve addresses as if requests are coming from 2 different VLANs. It seems to work when the local dns server is running, but if it doesn't then I hit this problem.

I was expecting ClientResult to come back so I can handle even if DNS server isn't running but for some reason I get a panic. Thanks!

<!-- gh-comment-id:304161942 --> @opensourcegeek commented on GitHub (May 26, 2017): I've a slightly complex setup. There is a local dns server (which forwards to another dns server) and the idea is to check if I can resolve addresses as if requests are coming from 2 different VLANs. It seems to work when the local dns server is running, but if it doesn't then I hit this problem. I was expecting ClientResult to come back so I can handle even if DNS server isn't running but for some reason I get a panic. Thanks!
Author
Owner

@bluejekyll commented on GitHub (May 26, 2017):

I'm looking at your stacktrace. It's not obvious to me who's code is panicking; but I think I have some negative tests for that case... so it should be recoverable. I don't see anything obviously wrong with your code, so it is possible you uncovered a bug, but I haven't had any other reports around the timeout logic, and I've definitely seen it in the wild myself without a panic.

Btw, it looks like you're using threads for the timeout. If you're a little more adventurous you could use the ClientFuture which is async and wouldn't require the separate thread.

<!-- gh-comment-id:304176741 --> @bluejekyll commented on GitHub (May 26, 2017): I'm looking at your stacktrace. It's not obvious to me who's code is panicking; but I think I have some negative tests for that case... so it should be recoverable. I don't see anything obviously wrong with your code, so it is possible you uncovered a bug, but I haven't had any other reports around the timeout logic, and I've definitely seen it in the wild myself without a panic. Btw, it looks like you're using threads for the timeout. If you're a little more adventurous you could use the ClientFuture which is async and wouldn't require the separate thread.
Author
Owner

@bluejekyll commented on GitHub (May 26, 2017):

I just reviewed my tests. I have timeout tests on ClientFuture, but not on SyncClient. I'll add one there and see what I can uncover.

<!-- gh-comment-id:304187208 --> @bluejekyll commented on GitHub (May 26, 2017): I just reviewed my tests. I have timeout tests on ClientFuture, but not on SyncClient. I'll add one there and see what I can uncover.
Author
Owner

@bluejekyll commented on GitHub (May 26, 2017):

Ok, so I don't see any issues with the new tests I've added. See #138 for validation.

This did help uncover a different issue, where TCP initial connection isn't abiding by the timeout. I will look into a fix for that.

<!-- gh-comment-id:304212714 --> @bluejekyll commented on GitHub (May 26, 2017): Ok, so I don't see any issues with the new tests I've added. See #138 for validation. This did help uncover a different issue, where TCP initial connection isn't abiding by the timeout. I will look into a fix for that.
Author
Owner

@opensourcegeek commented on GitHub (May 26, 2017):

Thanks - it seems to be happening only when I have the outer loop, if I send the same address directly it doesn't seem to panic. According to backtrace it is on line I invoke client.query. I'll try to isolate it and let you know.

<!-- gh-comment-id:304217229 --> @opensourcegeek commented on GitHub (May 26, 2017): Thanks - it seems to be happening only when I have the outer loop, if I send the same address directly it doesn't seem to panic. According to backtrace it is on line I invoke `client.query`. I'll try to isolate it and let you know.
Author
Owner

@opensourcegeek commented on GitHub (May 26, 2017):

Below is code with most of the threads/channels all stripped out, I then noticed even though it looks like there's been a panic it seems to print "Took 5" and "Took 10" - same goes with threaded runner as well. So when I commented out prinln! in the Err branch the panic isn't printed to the screen. I then realized it is sending Error(Timeout...) along with the back trace! So I guess it's been working fine all along, I just saw whole backtrace and I thought the thread is panicking. Thanks again for looking into it and apologies for wasting your time. I'll look into ClientFuture as well.

extern crate trust_dns;

use std::net::{IpAddr, Ipv4Addr, SocketAddr};
use std::{thread, time};
use std::sync::mpsc;

use trust_dns::udp::UdpClientConnection;
use trust_dns::client::Client;
use trust_dns::client::SyncClient;
use trust_dns::rr::dns_class::DNSClass;
use trust_dns::rr::record_type::RecordType;
use trust_dns::rr::domain::Name;
use trust_dns::op::response_code::ResponseCode;



fn main() {

    let start = time::Instant::now();
    let socks = vec![SocketAddr::new(IpAddr::V4(Ipv4Addr::new(192, 168, 0, 2)), 53), SocketAddr::new(IpAddr::V4(Ipv4Addr::new(192, 168, 0, 2)), 53)];
    
    for s in socks {
            // TODO: No unwraps please..
            let connection = UdpClientConnection::new(s).unwrap();
            let client = SyncClient::new(connection);
            let res = client.query(&Name::new().label("google").label("co").label("uk"), DNSClass::IN, RecordType::A);
            match res {
                Ok(r) => {
                    println!("{:?}", r);
                    println!("{:?}", r.response_code());
                    match r.response_code() {
                        ResponseCode::NoError => {
                            let ip_add = &r.answers()[0];
                            println!("{:?}", ip_add);
                        },
                        _ => {
                            println!("Warning! Failed to resolve");
                        }
                    }
                },
                Err(e) => {
                    println!("{:?}", e);
                }
            }
        println!("Took {:?}", start.elapsed().as_secs());
    }
}

Error(Timeout, (None, stack backtrace:
   0:     0x556b9fffab51 - backtrace::backtrace::libunwind::trace
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/libunwind.rs:54
                         - backtrace::backtrace::trace<closure>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/mod.rs:70
   1:     0x556b9fffb9a3 - backtrace::capture::{{impl}}::new
                        at /home/opensourcegeek/projects/rust-playground/sample-dns/target/debug/build/backtrace-811cded9ab5b8ade/out/capture.rs:79
   2:     0x556b9ffd7c0b - trust_dns::error::client_error::{{impl}}::from
                        at /home/opensourcegeek/projects/rust-playground/sample-dns/<error_chain macros>:39
   3:     0x556b9ff3d927 - core::convert::{{impl}}::into<trust_dns::error::client_error::ErrorKind,trust_dns::error::client_error::Error>
                        at /checkout/src/libcore/convert.rs:279
   4:     0x556b9ff43404 - trust_dns::client::client_future::{{impl}}::drop_cancelled<trust_dns::udp::udp_client_stream::UdpClientStream>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client_future.rs:158
   5:     0x556b9ff5523c - trust_dns::client::client_future::{{impl}}::poll<trust_dns::udp::udp_client_stream::UdpClientStream>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client_future.rs:186
   6:     0x556b9ff43f07 - futures::future::chain::{{impl}}::poll<futures::future::map::Map<alloc::boxed::Box<Future>, closure>,trust_dns::client::client_future::ClientFuture<trust_dns::udp::udp_client_stream::UdpClientStream>,(),closure>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/chain.rs:32
   7:     0x556b9ff5384b - futures::future::flatten::{{impl}}::poll<futures::future::map::Map<alloc::boxed::Box<Future>, closure>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/flatten.rs:44
   8:     0x556b9ff54986 - futures::future::map_err::{{impl}}::poll<(),futures::future::flatten::Flatten<futures::future::map::Map<alloc::boxed::Box<Future>, closure>>,closure>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/map_err.rs:30
   9:     0x556ba002cd41 - futures::future::{{impl}}::poll<Future>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/mod.rs:106
  10:     0x556ba001a06c - futures::task_impl::{{impl}}::poll_future::{{closure}}<alloc::boxed::Box<Future>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:337
  11:     0x556ba001a46e - futures::task_impl::{{impl}}::enter::{{closure}}<alloc::boxed::Box<Future>,closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:484
  12:     0x556ba002e2b3 - futures::task_impl::set::{{closure}}<closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:61
  13:     0x556ba001bd07 - std::thread::local::{{impl}}::with<core::cell::Cell<*const futures::task_impl::BorrowedTask>,closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /checkout/src/libstd/thread/local.rs:253
  14:     0x556ba002e13f - futures::task_impl::set<closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:54
  15:     0x556ba001a3be - futures::task_impl::{{impl}}::enter<alloc::boxed::Box<Future>,closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:484
  16:     0x556ba0019ff7 - futures::task_impl::{{impl}}::poll_future<alloc::boxed::Box<Future>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:337
  17:     0x556ba00386d2 - tokio_core::reactor::{{impl}}::dispatch_task::{{closure}}
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:366
  18:     0x556ba00167b4 - scoped_tls::{{impl}}::set<tokio_core::reactor::Core,closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.0/src/lib.rs:135
  19:     0x556ba00381a0 - tokio_core::reactor::{{impl}}::dispatch_task
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:366
  20:     0x556ba00376e5 - tokio_core::reactor::{{impl}}::dispatch
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:324
  21:     0x556ba003724b - tokio_core::reactor::{{impl}}::poll
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:312
  22:     0x556b9ff1f7a4 - tokio_core::reactor::{{impl}}::run<alloc::boxed::Box<Future>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:249
  23:     0x556b9ff58913 - trust_dns::client::client::Client::query<trust_dns::client::client::SyncClient,trust_dns::client::client_future::BasicClientHandle>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client.rs:61
  24:     0x556b9ff58e0d - sample_dns::main
                        at /home/opensourcegeek/projects/rust-playground/sample-dns/src/main.rs:26
  25:     0x556ba0064925 - std::panicking::try::do_call<fn(),()>
                        at /checkout/src/libstd/panicking.rs:454
  26:     0x556ba006bc0a - panic_unwind::__rust_maybe_catch_panic
                        at /checkout/src/libpanic_unwind/lib.rs:98
  27:     0x556ba00653d6 - std::panicking::try<(),fn()>
                        at /checkout/src/libstd/panicking.rs:433
                         - std::panic::catch_unwind<fn(),()>
                        at /checkout/src/libstd/panic.rs:361
                         - std::rt::lang_start
                        at /checkout/src/libstd/rt.rs:57
  28:     0x556b9ff59632 - main
  29:     0x7f6eb36326ff - __libc_start_main
  30:     0x556b9ff1ee28 - _start
  31:                0x0 - <unknown>))
Took 5
Error(Timeout, (None, stack backtrace:
   0:     0x556b9fffab51 - backtrace::backtrace::libunwind::trace
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/libunwind.rs:54
                         - backtrace::backtrace::trace<closure>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/mod.rs:70
   1:     0x556b9fffb9a3 - backtrace::capture::{{impl}}::new
                        at /home/opensourcegeek/projects/rust-playground/sample-dns/target/debug/build/backtrace-811cded9ab5b8ade/out/capture.rs:79
   2:     0x556b9ffd7c0b - trust_dns::error::client_error::{{impl}}::from
                        at /home/opensourcegeek/projects/rust-playground/sample-dns/<error_chain macros>:39
   3:     0x556b9ff3d927 - core::convert::{{impl}}::into<trust_dns::error::client_error::ErrorKind,trust_dns::error::client_error::Error>
                        at /checkout/src/libcore/convert.rs:279
   4:     0x556b9ff43404 - trust_dns::client::client_future::{{impl}}::drop_cancelled<trust_dns::udp::udp_client_stream::UdpClientStream>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client_future.rs:158
   5:     0x556b9ff5523c - trust_dns::client::client_future::{{impl}}::poll<trust_dns::udp::udp_client_stream::UdpClientStream>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client_future.rs:186
   6:     0x556b9ff43f07 - futures::future::chain::{{impl}}::poll<futures::future::map::Map<alloc::boxed::Box<Future>, closure>,trust_dns::client::client_future::ClientFuture<trust_dns::udp::udp_client_stream::UdpClientStream>,(),closure>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/chain.rs:32
   7:     0x556b9ff5384b - futures::future::flatten::{{impl}}::poll<futures::future::map::Map<alloc::boxed::Box<Future>, closure>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/flatten.rs:44
   8:     0x556b9ff54986 - futures::future::map_err::{{impl}}::poll<(),futures::future::flatten::Flatten<futures::future::map::Map<alloc::boxed::Box<Future>, closure>>,closure>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/map_err.rs:30
   9:     0x556ba002cd41 - futures::future::{{impl}}::poll<Future>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/mod.rs:106
  10:     0x556ba001a06c - futures::task_impl::{{impl}}::poll_future::{{closure}}<alloc::boxed::Box<Future>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:337
  11:     0x556ba001a46e - futures::task_impl::{{impl}}::enter::{{closure}}<alloc::boxed::Box<Future>,closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:484
  12:     0x556ba002e2b3 - futures::task_impl::set::{{closure}}<closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:61
  13:     0x556ba001bd07 - std::thread::local::{{impl}}::with<core::cell::Cell<*const futures::task_impl::BorrowedTask>,closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /checkout/src/libstd/thread/local.rs:253
  14:     0x556ba002e13f - futures::task_impl::set<closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:54
  15:     0x556ba001a3be - futures::task_impl::{{impl}}::enter<alloc::boxed::Box<Future>,closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:484
  16:     0x556ba0019ff7 - futures::task_impl::{{impl}}::poll_future<alloc::boxed::Box<Future>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:337
  17:     0x556ba00386d2 - tokio_core::reactor::{{impl}}::dispatch_task::{{closure}}
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:366
  18:     0x556ba00167b4 - scoped_tls::{{impl}}::set<tokio_core::reactor::Core,closure,core::result::Result<futures::poll::Async<()>, ()>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.0/src/lib.rs:135
  19:     0x556ba00381a0 - tokio_core::reactor::{{impl}}::dispatch_task
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:366
  20:     0x556ba00376e5 - tokio_core::reactor::{{impl}}::dispatch
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:324
  21:     0x556ba003724b - tokio_core::reactor::{{impl}}::poll
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:312
  22:     0x556b9ff1f7a4 - tokio_core::reactor::{{impl}}::run<alloc::boxed::Box<Future>>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:249
  23:     0x556b9ff58913 - trust_dns::client::client::Client::query<trust_dns::client::client::SyncClient,trust_dns::client::client_future::BasicClientHandle>
                        at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client.rs:61
  24:     0x556b9ff58e0d - sample_dns::main
                        at /home/opensourcegeek/projects/rust-playground/sample-dns/src/main.rs:26
  25:     0x556ba0064925 - std::panicking::try::do_call<fn(),()>
                        at /checkout/src/libstd/panicking.rs:454
  26:     0x556ba006bc0a - panic_unwind::__rust_maybe_catch_panic
                        at /checkout/src/libpanic_unwind/lib.rs:98
  27:     0x556ba00653d6 - std::panicking::try<(),fn()>
                        at /checkout/src/libstd/panicking.rs:433
                         - std::panic::catch_unwind<fn(),()>
                        at /checkout/src/libstd/panic.rs:361
                         - std::rt::lang_start
                        at /checkout/src/libstd/rt.rs:57
  28:     0x556b9ff59632 - main
  29:     0x7f6eb36326ff - __libc_start_main
  30:     0x556b9ff1ee28 - _start
  31:                0x0 - <unknown>))
Took 10
<!-- gh-comment-id:304222588 --> @opensourcegeek commented on GitHub (May 26, 2017): Below is code with most of the threads/channels all stripped out, I then noticed even though it looks like there's been a panic it seems to print "Took 5" and "Took 10" - same goes with threaded runner as well. So when I commented out `prinln!` in the `Err` branch the panic isn't printed to the screen. I then realized it is sending `Error(Timeout...)` along with the back trace! So I guess it's been working fine all along, I just saw whole backtrace and I thought the thread is panicking. Thanks again for looking into it and apologies for wasting your time. I'll look into `ClientFuture` as well. ```rust extern crate trust_dns; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::{thread, time}; use std::sync::mpsc; use trust_dns::udp::UdpClientConnection; use trust_dns::client::Client; use trust_dns::client::SyncClient; use trust_dns::rr::dns_class::DNSClass; use trust_dns::rr::record_type::RecordType; use trust_dns::rr::domain::Name; use trust_dns::op::response_code::ResponseCode; fn main() { let start = time::Instant::now(); let socks = vec![SocketAddr::new(IpAddr::V4(Ipv4Addr::new(192, 168, 0, 2)), 53), SocketAddr::new(IpAddr::V4(Ipv4Addr::new(192, 168, 0, 2)), 53)]; for s in socks { // TODO: No unwraps please.. let connection = UdpClientConnection::new(s).unwrap(); let client = SyncClient::new(connection); let res = client.query(&Name::new().label("google").label("co").label("uk"), DNSClass::IN, RecordType::A); match res { Ok(r) => { println!("{:?}", r); println!("{:?}", r.response_code()); match r.response_code() { ResponseCode::NoError => { let ip_add = &r.answers()[0]; println!("{:?}", ip_add); }, _ => { println!("Warning! Failed to resolve"); } } }, Err(e) => { println!("{:?}", e); } } println!("Took {:?}", start.elapsed().as_secs()); } } ``` ``` Error(Timeout, (None, stack backtrace: 0: 0x556b9fffab51 - backtrace::backtrace::libunwind::trace at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/libunwind.rs:54 - backtrace::backtrace::trace<closure> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/mod.rs:70 1: 0x556b9fffb9a3 - backtrace::capture::{{impl}}::new at /home/opensourcegeek/projects/rust-playground/sample-dns/target/debug/build/backtrace-811cded9ab5b8ade/out/capture.rs:79 2: 0x556b9ffd7c0b - trust_dns::error::client_error::{{impl}}::from at /home/opensourcegeek/projects/rust-playground/sample-dns/<error_chain macros>:39 3: 0x556b9ff3d927 - core::convert::{{impl}}::into<trust_dns::error::client_error::ErrorKind,trust_dns::error::client_error::Error> at /checkout/src/libcore/convert.rs:279 4: 0x556b9ff43404 - trust_dns::client::client_future::{{impl}}::drop_cancelled<trust_dns::udp::udp_client_stream::UdpClientStream> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client_future.rs:158 5: 0x556b9ff5523c - trust_dns::client::client_future::{{impl}}::poll<trust_dns::udp::udp_client_stream::UdpClientStream> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client_future.rs:186 6: 0x556b9ff43f07 - futures::future::chain::{{impl}}::poll<futures::future::map::Map<alloc::boxed::Box<Future>, closure>,trust_dns::client::client_future::ClientFuture<trust_dns::udp::udp_client_stream::UdpClientStream>,(),closure> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/chain.rs:32 7: 0x556b9ff5384b - futures::future::flatten::{{impl}}::poll<futures::future::map::Map<alloc::boxed::Box<Future>, closure>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/flatten.rs:44 8: 0x556b9ff54986 - futures::future::map_err::{{impl}}::poll<(),futures::future::flatten::Flatten<futures::future::map::Map<alloc::boxed::Box<Future>, closure>>,closure> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/map_err.rs:30 9: 0x556ba002cd41 - futures::future::{{impl}}::poll<Future> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/mod.rs:106 10: 0x556ba001a06c - futures::task_impl::{{impl}}::poll_future::{{closure}}<alloc::boxed::Box<Future>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:337 11: 0x556ba001a46e - futures::task_impl::{{impl}}::enter::{{closure}}<alloc::boxed::Box<Future>,closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:484 12: 0x556ba002e2b3 - futures::task_impl::set::{{closure}}<closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:61 13: 0x556ba001bd07 - std::thread::local::{{impl}}::with<core::cell::Cell<*const futures::task_impl::BorrowedTask>,closure,core::result::Result<futures::poll::Async<()>, ()>> at /checkout/src/libstd/thread/local.rs:253 14: 0x556ba002e13f - futures::task_impl::set<closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:54 15: 0x556ba001a3be - futures::task_impl::{{impl}}::enter<alloc::boxed::Box<Future>,closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:484 16: 0x556ba0019ff7 - futures::task_impl::{{impl}}::poll_future<alloc::boxed::Box<Future>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:337 17: 0x556ba00386d2 - tokio_core::reactor::{{impl}}::dispatch_task::{{closure}} at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:366 18: 0x556ba00167b4 - scoped_tls::{{impl}}::set<tokio_core::reactor::Core,closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.0/src/lib.rs:135 19: 0x556ba00381a0 - tokio_core::reactor::{{impl}}::dispatch_task at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:366 20: 0x556ba00376e5 - tokio_core::reactor::{{impl}}::dispatch at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:324 21: 0x556ba003724b - tokio_core::reactor::{{impl}}::poll at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:312 22: 0x556b9ff1f7a4 - tokio_core::reactor::{{impl}}::run<alloc::boxed::Box<Future>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:249 23: 0x556b9ff58913 - trust_dns::client::client::Client::query<trust_dns::client::client::SyncClient,trust_dns::client::client_future::BasicClientHandle> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client.rs:61 24: 0x556b9ff58e0d - sample_dns::main at /home/opensourcegeek/projects/rust-playground/sample-dns/src/main.rs:26 25: 0x556ba0064925 - std::panicking::try::do_call<fn(),()> at /checkout/src/libstd/panicking.rs:454 26: 0x556ba006bc0a - panic_unwind::__rust_maybe_catch_panic at /checkout/src/libpanic_unwind/lib.rs:98 27: 0x556ba00653d6 - std::panicking::try<(),fn()> at /checkout/src/libstd/panicking.rs:433 - std::panic::catch_unwind<fn(),()> at /checkout/src/libstd/panic.rs:361 - std::rt::lang_start at /checkout/src/libstd/rt.rs:57 28: 0x556b9ff59632 - main 29: 0x7f6eb36326ff - __libc_start_main 30: 0x556b9ff1ee28 - _start 31: 0x0 - <unknown>)) Took 5 Error(Timeout, (None, stack backtrace: 0: 0x556b9fffab51 - backtrace::backtrace::libunwind::trace at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/libunwind.rs:54 - backtrace::backtrace::trace<closure> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.2.3/src/backtrace/mod.rs:70 1: 0x556b9fffb9a3 - backtrace::capture::{{impl}}::new at /home/opensourcegeek/projects/rust-playground/sample-dns/target/debug/build/backtrace-811cded9ab5b8ade/out/capture.rs:79 2: 0x556b9ffd7c0b - trust_dns::error::client_error::{{impl}}::from at /home/opensourcegeek/projects/rust-playground/sample-dns/<error_chain macros>:39 3: 0x556b9ff3d927 - core::convert::{{impl}}::into<trust_dns::error::client_error::ErrorKind,trust_dns::error::client_error::Error> at /checkout/src/libcore/convert.rs:279 4: 0x556b9ff43404 - trust_dns::client::client_future::{{impl}}::drop_cancelled<trust_dns::udp::udp_client_stream::UdpClientStream> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client_future.rs:158 5: 0x556b9ff5523c - trust_dns::client::client_future::{{impl}}::poll<trust_dns::udp::udp_client_stream::UdpClientStream> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client_future.rs:186 6: 0x556b9ff43f07 - futures::future::chain::{{impl}}::poll<futures::future::map::Map<alloc::boxed::Box<Future>, closure>,trust_dns::client::client_future::ClientFuture<trust_dns::udp::udp_client_stream::UdpClientStream>,(),closure> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/chain.rs:32 7: 0x556b9ff5384b - futures::future::flatten::{{impl}}::poll<futures::future::map::Map<alloc::boxed::Box<Future>, closure>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/flatten.rs:44 8: 0x556b9ff54986 - futures::future::map_err::{{impl}}::poll<(),futures::future::flatten::Flatten<futures::future::map::Map<alloc::boxed::Box<Future>, closure>>,closure> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/map_err.rs:30 9: 0x556ba002cd41 - futures::future::{{impl}}::poll<Future> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/future/mod.rs:106 10: 0x556ba001a06c - futures::task_impl::{{impl}}::poll_future::{{closure}}<alloc::boxed::Box<Future>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:337 11: 0x556ba001a46e - futures::task_impl::{{impl}}::enter::{{closure}}<alloc::boxed::Box<Future>,closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:484 12: 0x556ba002e2b3 - futures::task_impl::set::{{closure}}<closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:61 13: 0x556ba001bd07 - std::thread::local::{{impl}}::with<core::cell::Cell<*const futures::task_impl::BorrowedTask>,closure,core::result::Result<futures::poll::Async<()>, ()>> at /checkout/src/libstd/thread/local.rs:253 14: 0x556ba002e13f - futures::task_impl::set<closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:54 15: 0x556ba001a3be - futures::task_impl::{{impl}}::enter<alloc::boxed::Box<Future>,closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:484 16: 0x556ba0019ff7 - futures::task_impl::{{impl}}::poll_future<alloc::boxed::Box<Future>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.13/src/task_impl/mod.rs:337 17: 0x556ba00386d2 - tokio_core::reactor::{{impl}}::dispatch_task::{{closure}} at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:366 18: 0x556ba00167b4 - scoped_tls::{{impl}}::set<tokio_core::reactor::Core,closure,core::result::Result<futures::poll::Async<()>, ()>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.0/src/lib.rs:135 19: 0x556ba00381a0 - tokio_core::reactor::{{impl}}::dispatch_task at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:366 20: 0x556ba00376e5 - tokio_core::reactor::{{impl}}::dispatch at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:324 21: 0x556ba003724b - tokio_core::reactor::{{impl}}::poll at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:312 22: 0x556b9ff1f7a4 - tokio_core::reactor::{{impl}}::run<alloc::boxed::Box<Future>> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.7/src/reactor/mod.rs:249 23: 0x556b9ff58913 - trust_dns::client::client::Client::query<trust_dns::client::client::SyncClient,trust_dns::client::client_future::BasicClientHandle> at /home/opensourcegeek/.cargo/registry/src/github.com-1ecc6299db9ec823/trust-dns-0.10.0/src/client/client.rs:61 24: 0x556b9ff58e0d - sample_dns::main at /home/opensourcegeek/projects/rust-playground/sample-dns/src/main.rs:26 25: 0x556ba0064925 - std::panicking::try::do_call<fn(),()> at /checkout/src/libstd/panicking.rs:454 26: 0x556ba006bc0a - panic_unwind::__rust_maybe_catch_panic at /checkout/src/libpanic_unwind/lib.rs:98 27: 0x556ba00653d6 - std::panicking::try<(),fn()> at /checkout/src/libstd/panicking.rs:433 - std::panic::catch_unwind<fn(),()> at /checkout/src/libstd/panic.rs:361 - std::rt::lang_start at /checkout/src/libstd/rt.rs:57 28: 0x556b9ff59632 - main 29: 0x7f6eb36326ff - __libc_start_main 30: 0x556b9ff1ee28 - _start 31: 0x0 - <unknown>)) Took 10 ```
Author
Owner

@bluejekyll commented on GitHub (May 26, 2017):

No problem! You did help me notice that there is a bug in the TCP connect with timeout logic that I need to fix. So, it's not a waste of time.

<!-- gh-comment-id:304222977 --> @bluejekyll commented on GitHub (May 26, 2017): No problem! You did help me notice that there is a bug in the TCP connect with timeout logic that I need to fix. So, it's not a waste of time.
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#363
No description provided.