[#70252] Re: [ruby-cvs:58640] nobu:r51492 (trunk): node.c: NODE_ALLOCA for ALLOCV — Eric Wong <normalperson@...>
Besides possible backwards compatibility, can we drop volatile
3 messages
2015/08/05
[#70257] [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI — ko1@...
Issue #11420 has been reported by Koichi Sasada.
11 messages
2015/08/06
[#70337] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/11
Nice. Thank you guys for looking into this.
[#70349] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/12
Btw, did you consider using flexible array to avoid extra malloc
[#70355] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Юрий Соколов <funny.falcon@...>
2015/08/12
I thought to suggest to embed hash_id_table directly into places when it is
[#70356] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— SASADA Koichi <ko1@...>
2015/08/12
On 2015/08/13 4:29, Юрий Соколов wrote:
[#70358] Re: [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI
— Eric Wong <normalperson@...>
2015/08/12
SASADA Koichi <ko1@atdot.net> wrote:
[#70509] [Ruby trunk - Misc #11276] [RFC] compile.c: convert to use ccan/list — ko1@...
Issue #11276 has been updated by Koichi Sasada.
3 messages
2015/08/21
[#70639] the undefined behavior of an iterator if it is modified inside of the block to which it yields — Daniel Doubrovkine <dblock@...>
(this is my first time e-mailing list list, so apologies for any misstep :)
4 messages
2015/08/31
[ruby-core:70377] [Ruby trunk - Bug #11443] DNS name resolution takes twice as long as it should when primary name server is unavailable
From:
therealpatrobinson@...
Date:
2015-08-14 04:54:50 UTC
List:
ruby-core #70377
Issue #11443 has been updated by Patrick Robinson.
Subject changed from DNS name resolution takes a twice as long as it should when primary name server is unavailable to DNS name resolution takes twice as long as it should when primary name server is unavailable
Description updated
----------------------------------------
Bug #11443: DNS name resolution takes twice as long as it should when primary name server is unavailable
https://bugs.ruby-lang.org/issues/11443#change-53781
* Author: Patrick Robinson
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
On linux /etc/resolv.conf can be configured to set the timeout of a nameserver before trying the next one (defaults to 5 seconds). So in the event of a failed name server we expect the time taken to resolve a hostname will be timeout + query time. However testing shows it takes (2 * timeout) + query time. Example resolv.conf to replicate the problem of a failed name server:
~~~
nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver 8.8.4.4
~~~
Example ruby code to test:
```
require 'net/protocol'
require 'uri'
require 'benchmark'
uri = URI.parse("http://google.com")
Benchmark.measure { TCPSocket.new(uri.host, uri.port) }.real
```
Example benchmark with a above resolv.conf:
```
irb(main):005:0> Benchmark.measure { TCPSocket.new(uri.host, uri.port) }.real
=> 10.593100978
```
Example benchmark with timeout set to 3 in resolv.conf (options timeout:3):
```
irb(main):005:0> Benchmark.measure { TCPSocket.new(uri.host, uri.port) }.real
=> 6.262138267
```
and without the invalid nameserver:
```
irb(main):005:0> Benchmark.measure { TCPSocket.new(uri.host, uri.port) }.real
=> 0.243385728
```
Example C code that proves the resolver is behaving as expected:
```
#include <stdio.h>
#include <netdb.h>
int main(int argc, char *argv[])
{
struct hostent *hstnm;
if (argc != 2) {
fprintf(stderr, "usage: %s hostname\n", argv[0]);
return 1;
}
hstnm = gethostbyname (argv[1]);
if (!hstnm)
return 1;
printf ("Name: %s\n", hstnm->h_name);
return 0;
}
```
Benchmark of C code with failed nameserver:
~~~
$ time ./gethostbyname google.com
Name: google.com
real 0m5.189s
user 0m0.000s
sys 0m0.000s
~~~
Benchmark of C code without failed nameserver:
~~~
$ time ./gethostbyname google.com
Name: google.com
real 0m0.040s
user 0m0.000s
sys 0m0.000s
~~~
--
https://bugs.ruby-lang.org/