https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112016-12-06T01:02:17ZRuby Issue Tracking SystemRuby master - Bug #13007: Webbrick takes 5s to start when machine name looks like a real domainhttps://redmine.ruby-lang.org/issues/13007?journal_id=618782016-12-06T01:02:17Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul></ul><p>Sad news is gethostbyname blocks under the hood in the system library, not in ruby's code.</p>
<p>But webrick's issue might be resolved already by issue <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Set DoNotReverseLookup to true in Webrick (Closed)" href="https://redmine.ruby-lang.org/issues/6559">#6559</a>. Can you try the latest trunk to see if that fixed your problem?</p> Ruby master - Bug #13007: Webbrick takes 5s to start when machine name looks like a real domainhttps://redmine.ruby-lang.org/issues/13007?journal_id=618822016-12-06T01:15:27Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/6559">Feature #6559</a>: Set DoNotReverseLookup to true in Webrick</i> added</li></ul> Ruby master - Bug #13007: Webbrick takes 5s to start when machine name looks like a real domainhttps://redmine.ruby-lang.org/issues/13007?journal_id=619102016-12-07T05:11:35Zshugo (Shugo Maeda)
<ul></ul><p>Shyouhei Urabe wrote:</p>
<blockquote>
<p>Sad news is gethostbyname blocks under the hood in the system library, not in ruby's code.</p>
<p>But webrick's issue might be resolved already by issue <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Set DoNotReverseLookup to true in Webrick (Closed)" href="https://redmine.ruby-lang.org/issues/6559">#6559</a>. Can you try the latest trunk to see if that fixed your problem?</p>
</blockquote>
<p>It seems not a reverse lookup issue, but a forward lookup issue.</p>
<p>It sounds reasonable to delay the call of Utils.getservername so that<br>
users can override ServerName, in which case there's no need to call<br>
Utils.getservername.</p> Ruby master - Bug #13007: Webbrick takes 5s to start when machine name looks like a real domainhttps://redmine.ruby-lang.org/issues/13007?journal_id=619112016-12-07T08:27:07Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul></ul><p>Hmm, I see. No objection for the approach then.</p> Ruby master - Bug #13007: Webbrick takes 5s to start when machine name looks like a real domainhttps://redmine.ruby-lang.org/issues/13007?journal_id=619122016-12-07T12:59:53Zshugo (Shugo Maeda)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset r57014.</p>
<hr>
<p>Delay Utils.getservername until needed.</p>
<p>There is no need to call Utils.getservername when the :ServerName option is<br>
specified, so delay Utils.getservername until needed to avoid unnecessary<br>
DNS lookups. <a href="/issues/13007">[ruby-core:78492]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Webbrick takes 5s to start when machine name looks like a real domain (Closed)" href="https://redmine.ruby-lang.org/issues/13007">#13007</a>]</p>