Skip to content

Commit 859490f

Browse files
committed
Update hostname in test to avoid possible hungs in case of troubles with DNS
For instance it can hung here: (lldb) bt * thread 2, name = 'interpreter::op', stop reason = signal SIGSTOP * frame 0: 0x00007ffff7c9f002 libc.so.6`__syscall_cancel_arch + 50 at syscall_cancel.S:56 frame 1: 0x00007ffff7c9316c libc.so.6`__internal_syscall_cancel(a1=<unavailable>, a2=<unavailable>, a3=<unavailable>, a4=<unavailable>, a5=8, a6=0, nr=271) + 92 at cancellation.c:49 frame 2: 0x00007ffff7c931b4 libc.so.6`__syscall_cancel(a1=<unavailable>, a2=<unavailable>, a3=<unavailable>, a4=<unavailable>, a5=8, a6=0, nr=271) + 20 at cancellation.c:75 frame 3: 0x00007ffff7d0d9f6 libc.so.6`__GI_ppoll(fds=<unavailable>, nfds=<unavailable>, timeout=<unavailable>, sigmask=<unavailable>) + 70 at ppoll.c:42 frame 4: 0x00007ffff7eb86a9 libnss_resolve.so.2`ppoll(__fds=0x00007ffff6df4c10, __nfds=1, __timeout=<unavailable>, __ss=0x0000000000000000) + 14 at poll2.h:101 frame 5: 0x00007ffff7eb869b libnss_resolve.so.2`ppoll_usec_full(ss=0x0000000000000000, fds=0x00007ffff6df4c10, n_fds=<unavailable>, timeout=<unavailable>, ss=0x0000000000000000) + 63 at io-util.c:214 frame 6: 0x00007ffff7eb865c libnss_resolve.so.2`ppoll_usec(fds=0x00007ffff6df4c10, n_fds=<unavailable>, timeout=<unavailable>) at io-util.h:20 frame 7: 0x00007ffff7eb865c libnss_resolve.so.2`sd_varlink_wait(timeout=18446744073709551615, v=0x00007ffff00087e0) + 156 at sd-varlink.c:1677 frame 8: 0x00007ffff7eb85c0 libnss_resolve.so.2`sd_varlink_call_full.constprop.0(v=0x00007ffff00087e0, method=<unavailable>, parameters=<unavailable>, ret_parameters=<unavailable>, ret_error_id=<unavailable>, ret_flags=0x0000000000000000) + 2256 at sd-varlink.c:2231 frame 9: 0x00007ffff7eaba4a libnss_resolve.so.2`sd_varlink_call(v=0x00007ffff00087e0, method=0x0000000000026fd8, parameters=<unavailable>, ret_parameters=0x00007ffff6df4ce8, ret_error_id=0x00007ffff6df4cd8) + 5 at sd-varlink.c:2281 frame 10: 0x00007ffff7eaba45 libnss_resolve.so.2`_nss_resolve_gethostbyname4_r(name=0x00007ffff6df5a38, pat=0x00007ffff6df4ee0, buffer=0x00007ffff6df4ff0, buflen=1024, errnop=0x00007ffff6df85c8, h_errnop=0x00007ffff6df8600, ttlp=0x0000000000000000) + 517 at nss-resolve.c:230 frame 11: 0x00007ffff7d4921c libc.so.6`get_nss_addresses(name=<unavailable>, req=<unavailable>, tmpbuf=0x00007ffff6df4fe0, res=0x00007ffff6df4ee0) + 150 at getaddrinfo.c:656 frame 12: 0x00007ffff7d49186 libc.so.6`gaih_inet(name=<unavailable>, service=<unavailable>, req=<unavailable>, pai=0x00007ffff6df4eb0, naddrs=<unavailable>, tmpbuf=0x00007ffff6df4fe0) + 80 at getaddrinfo.c:1189 frame 13: 0x00007ffff7d49136 libc.so.6`__GI_getaddrinfo(name=<unavailable>, service=<unavailable>, hints=<unavailable>, pai=<unavailable>) + 6262 at getaddrinfo.c:2382 frame 14: 0x000055555594400b chdig-a3029faa4105d570`_$LT$std..sys..net..connection..socket..LookupHost$u20$as$u20$core..convert..TryFrom$LT$$LP$$RF$str$C$u16$RP$$GT$$GT$::try_from::_$u7b$$u7b$closure$u7d$$u7d$::he82ea9b7e347a0cb + 91 at socket.rs:319 frame 15: 0x0000555555943f94 chdig-a3029faa4105d570`std::sys::pal::common::small_c_string::run_with_cstr_stack::h31546a29d4719df4 + 420 at small_c_string.rs:48 frame 16: 0x0000555555943f47 chdig-a3029faa4105d570`std::sys::pal::common::small_c_string::run_with_cstr::h312805d7c7f449ea + 16 at small_c_string.rs:28 frame 17: 0x0000555555943f37 chdig-a3029faa4105d570`_$LT$std..sys..net..connection..socket..LookupHost$u20$as$u20$core..convert..TryFrom$LT$$LP$$RF$str$C$u16$RP$$GT$$GT$::try_from::hdad0e8e532721659 + 12 at socket.rs:314 frame 18: 0x0000555555943f2b chdig-a3029faa4105d570`_$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::hcfe756111fb56f1c at mod.rs:806 frame 19: 0x0000555555943f2b chdig-a3029faa4105d570`_$LT$std..sys..net..connection..socket..LookupHost$u20$as$u20$core..convert..TryFrom$LT$$RF$str$GT$$GT$::try_from::hddf70e8eeb214078 + 315 at socket.rs:304 frame 20: 0x0000555555939817 chdig-a3029faa4105d570`_$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$::try_into::h3863bee6c124c049 + 55 at mod.rs:806 frame 21: 0x000055555593980b chdig-a3029faa4105d570`_$LT$str$u20$as$u20$std..net..socket_addr..ToSocketAddrs$GT$::to_socket_addrs::hae429ba76aaba266 + 43 at socket_addr.rs:240 frame 22: 0x00005555559398ca chdig-a3029faa4105d570`_$LT$alloc..string..String$u20$as$u20$std..net..socket_addr..ToSocketAddrs$GT$::to_socket_addrs::hc3bbe914133eff85 + 26 at socket_addr.rs:265 frame 23: 0x000055555570af58 chdig-a3029faa4105d570`chdig::interpreter::options::is_local_address::h52c3668243359b4c(host="foobar") + 312 at options.rs:365 frame 24: 0x000055555570e1bc chdig-a3029faa4105d570`chdig::interpreter::options::clickhouse_url_defaults::he5ff5b3abdec6dc9(options=0x00007ffff6df70a0, config=Option<chdig::interpreter::options::ClickHouseClientConfig> @ 0x00007ffff6df72e8) + 10092 at options.rs:575 frame 25: 0x000055555575f07a chdig-a3029faa4105d570`chdig::interpreter::options::tests::test_config_connections_host::h7f28369e31ff88c0 + 986 at options.rs:870 frame 26: 0x0000555555754e87 chdig-a3029faa4105d570`chdig::interpreter::options::tests::test_config_connections_host::_$u7b$$u7b$closure$u7d$$u7d$::h549d361bab0cbdac((null)=0x00007ffff6df7596) + 23 at options.rs:863 frame 27: 0x0000555555723566 chdig-a3029faa4105d570`core::ops::function::FnOnce::call_once::ha0728db158bd84ce((null)={closure_env0} @ 0x00007ffff6df7596, (null)=<unavailable>) + 22 at function.rs:250 frame 28: 0x00005555557bb7bb chdig-a3029faa4105d570`core::ops::function::FnOnce::call_once::ha47d6ddd475a0346 + 11 at function.rs:250 frame 29: 0x00005555557bb7b9 chdig-a3029faa4105d570`test::__rust_begin_short_backtrace::hd132fc43686374bd + 9 at lib.rs:648 frame 30: 0x00005555557ba9ae chdig-a3029faa4105d570`test::run_test_in_process::_$u7b$$u7b$closure$u7d$$u7d$::h0f01fa9d90dc3780 + 1902 at lib.rs:671 frame 31: 0x00005555557ba9a9 chdig-a3029faa4105d570`_$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h8f5e247490c5454f at unwind_safe.rs:272 frame 32: 0x00005555557ba9a9 chdig-a3029faa4105d570`std::panicking::catch_unwind::do_call::hd660c608cdc27881 + 21 at panicking.rs:589 frame 33: 0x00005555557ba994 chdig-a3029faa4105d570`std::panicking::catch_unwind::h62c5e82abde59ee2 at panicking.rs:552 frame 34: 0x00005555557ba994 chdig-a3029faa4105d570`std::panic::catch_unwind::h859eeb5d25a18338 at panic.rs:359 frame 35: 0x00005555557ba994 chdig-a3029faa4105d570`test::run_test_in_process::h20d78159e463d526 + 43 at lib.rs:671 frame 36: 0x00005555557ba969 chdig-a3029faa4105d570`test::run_test::_$u7b$$u7b$closure$u7d$$u7d$::h2139f84065ca24b0 + 1833 at lib.rs:592 frame 37: 0x000055555577e584 chdig-a3029faa4105d570`test::run_test::_$u7b$$u7b$closure$u7d$$u7d$::h5c7d020c6f249713 + 123 at lib.rs:622 frame 38: 0x000055555577e509 chdig-a3029faa4105d570`std::sys::backtrace::__rust_begin_short_backtrace::h4e3c7d08333a9edf + 25 at backtrace.rs:152 frame 39: 0x0000555555781f5a chdig-a3029faa4105d570`std::thread::Builder::spawn_unchecked_::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h092696b5ce2807be + 138 at mod.rs:559 frame 40: 0x0000555555781f4b chdig-a3029faa4105d570`_$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h8d045214ce3c9500 at unwind_safe.rs:272 frame 41: 0x0000555555781f4b chdig-a3029faa4105d570`std::panicking::catch_unwind::do_call::h2ebaf8800c621736 + 22 at panicking.rs:589 frame 42: 0x0000555555781f35 chdig-a3029faa4105d570`std::panicking::catch_unwind::hb8a200be3fa78cf5 at panicking.rs:552 frame 43: 0x0000555555781f35 chdig-a3029faa4105d570`std::panic::catch_unwind::hc44ba003de0e082b at panic.rs:359 frame 44: 0x0000555555781f35 chdig-a3029faa4105d570`std::thread::Builder::spawn_unchecked_::_$u7b$$u7b$closure$u7d$$u7d$::h788ac6b1b68123b6 + 81 at mod.rs:557 frame 45: 0x0000555555781ee4 chdig-a3029faa4105d570`core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::hc177b1a30cb09c3d + 20 at function.rs:250 frame 46: 0x00005555559419a7 chdig-a3029faa4105d570`_$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..FnOnce$LT$Args$GT$$GT$::call_once::h0c89ce8ccbe8374a + 8 at boxed.rs:1971 frame 47: 0x000055555594199f chdig-a3029faa4105d570`_$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..FnOnce$LT$Args$GT$$GT$::call_once::h95501e91258a6862 + 7 at boxed.rs:1971 frame 48: 0x0000555555941998 chdig-a3029faa4105d570`std::sys::pal::unix::thread::Thread::new::thread_start::h746b9bcf86250858 + 24 at thread.rs:97 frame 49: 0x00007ffff7c9698b libc.so.6`start_thread(arg=<unavailable>) + 747 at pthread_create.c:448 frame 50: 0x00007ffff7d1a9cc libc.so.6`__clone3 + 44 at clone3.S:78 frame 23: 0x000055555570af58 chdig-a3029faa4105d570`chdig::interpreter::options::is_local_address::h52c3668243359b4c(host="foobar") + 312 at options.rs:365 362 363 fn is_local_address(host: &str) -> bool { 364 let localhost = SocketAddr::from(([127, 0, 0, 1], 0)); -> 365 let addresses = format!("{}:0", host).to_socket_addrs(); 366 log::trace!("Resolving: {} -> {:?}", host, addresses); 367 if let Ok(addresses) = addresses { 368 for address in addresses { (lldb) p host (&str) "foobar" { [0] = 'f' [1] = 'o' [2] = 'o' [3] = 'b' [4] = 'a' [5] = 'r' }
1 parent b12826e commit 859490f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/interpreter/options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,13 +864,13 @@ mod tests {
864864
let config = read_yaml_clickhouse_client_config("tests/configs/connections.yaml").ok();
865865
let mut options = ClickHouseOptions {
866866
connection: Some("play-tls".into()),
867-
host: Some("foobar".into()),
867+
host: Some("localhost".into()),
868868
..Default::default()
869869
};
870870
clickhouse_url_defaults(&mut options, config).unwrap();
871871
assert_eq!(
872872
parse_url(&options).unwrap().host().unwrap().to_string(),
873-
"foobar"
873+
"localhost"
874874
);
875875
}
876876

0 commit comments

Comments
 (0)