https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112011-06-11T16:48:09ZRuby Issue Tracking SystemRuby master - Bug #4841: WEBrick threading leads to infinite loophttps://bugs.ruby-lang.org/issues/4841?journal_id=177692011-06-11T16:48:09Zko1 (Koichi Sasada)
<ul><li><strong>Assignee</strong> set to <i>gotoyuzo (GOTOU Yuuzou)</i></li></ul> Ruby master - Bug #4841: WEBrick threading leads to infinite loophttps://bugs.ruby-lang.org/issues/4841?journal_id=177702011-06-11T16:48:17Zko1 (Koichi Sasada)
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul> Ruby master - Bug #4841: WEBrick threading leads to infinite loophttps://bugs.ruby-lang.org/issues/4841?journal_id=181712011-06-23T16:58:26Znahi (Hiroshi Nakamura)nakahiro@gmail.com
<ul></ul><p>I guess that WEBrick::Server#{start,stop,shutdown} is not designed to be thread-safe and there's no simple fix for your usage. When I used WEBrick::Server for such purpose, I created my own lock outside of WEBrick::Server instances.</p>
<p>I'm going to ask gotoyuzo (the author) but please don't expect a response soon.</p>
<p>Do you think I understand the issue correctly?</p> Ruby master - Bug #4841: WEBrick threading leads to infinite loophttps://bugs.ruby-lang.org/issues/4841?journal_id=181722011-06-23T16:58:59Znahi (Hiroshi Nakamura)nakahiro@gmail.com
<ul><li><strong>Assignee</strong> changed from <i>gotoyuzo (GOTOU Yuuzou)</i> to <i>nahi (Hiroshi Nakamura)</i></li></ul> Ruby master - Bug #4841: WEBrick threading leads to infinite loophttps://bugs.ruby-lang.org/issues/4841?journal_id=682312017-12-08T12:38:50Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Assignee</strong> changed from <i>nahi (Hiroshi Nakamura)</i> to <i>normalperson (Eric Wong)</i></li></ul><p>normal, could you please check this ticket?</p> Ruby master - Bug #4841: WEBrick threading leads to infinite loophttps://bugs.ruby-lang.org/issues/4841?journal_id=682422017-12-08T18:52:07ZAnonymous
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>Applied in changeset trunk|r61083.</p>
<hr>
<p>webrick: allow shutdown after StartCallback</p>
<p>We must to ensure the @status ivar is set to :Running before<br>
running StartCallback, otherwise Webrick::Server#stop will not<br>
change the @status to :Shutdown properly.</p>
<p>Note: I have not been able to reproduce the original issue but<br>
understood at least part of the problem and fixed it with this<br>
commit. However, the original reporter (Peak Xu) was still able<br>
to reproduce the problem on 1.9.2 p180 on Windows, so I'm not<br>
sure what else might be going on. Ruby threading and<br>
synchronization primitives have changed a lot since 1.9.2, so<br>
maybe that was fixed elsewhere.</p>
<ul>
<li>lib/webrick/server.rb: call StartCallback sooner [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: WEBrick threading leads to infinite loop (Closed)" href="https://bugs.ruby-lang.org/issues/4841">#4841</a>]</li>
</ul> Ruby master - Bug #4841: WEBrick threading leads to infinite loophttps://bugs.ruby-lang.org/issues/4841?journal_id=682432017-12-08T19:21:19Znormalperson (Eric Wong)normalperson@yhbt.net
<ul></ul><p><a href="mailto:mame@ruby-lang.org" class="email">mame@ruby-lang.org</a> wrote:</p>
<blockquote>
<p>normal, could you please check this ticket?</p>
<hr>
<p>Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: WEBrick threading leads to infinite loop (Closed)" href="https://bugs.ruby-lang.org/issues/4841">#4841</a>: WEBrick threading leads to infinite loop<br>
<a href="https://bugs.ruby-lang.org/issues/4841#change-68231" class="external">https://bugs.ruby-lang.org/issues/4841#change-68231</a></p>
</blockquote>
<p>Sure, I think the problem is fixed in r61083.</p>
<p>Looking at the original run-this.rb script, it seems racy<br>
in that the Mutex does not synchronize enough scope for<br>
the ConditionVariable.</p> Ruby master - Bug #4841: WEBrick threading leads to infinite loophttps://bugs.ruby-lang.org/issues/4841?journal_id=682442017-12-08T21:54:40Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p>Thank you for your quick response!</p>