[#78949] [Ruby trunk Feature#13095] [PATCH] io.c (rb_f_syscall): remove deprecation notice — kosaki.motohiro@...
Issue #13095 has been updated by Motohiro KOSAKI.
3 messages
2017/01/03
[#78997] [Ruby trunk Bug#13110] Byte-based operations for String — shugo@...
Issue #13110 has been updated by Shugo Maeda.
3 messages
2017/01/06
[#79228] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150] — Eric Wong <normalperson@...>
naruse@ruby-lang.org wrote:
5 messages
2017/01/23
[#79511] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150]
— Eric Wong <normalperson@...>
2017/02/13
Eric Wong <normalperson@yhbt.net> wrote:
[#79518] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150]
— Nobuyoshi Nakada <nobu@...>
2017/02/13
On 2017/02/13 10:04, Eric Wong wrote:
[#79298] [Ruby trunk Bug#13085][Assigned] io.c io_fwrite creates garbage — nobu@...
Issue #13085 has been updated by Nobuyoshi Nakada.
3 messages
2017/01/29
[#79337] Re: [ruby-changes:45397] normal:r57469 (trunk): io.c: recycle garbage on write — SASADA Koichi <ko1@...>
Eric:
4 messages
2017/01/31
[#79352] Re: [ruby-changes:45397] normal:r57469 (trunk): io.c: recycle garbage on write
— Eric Wong <normalperson@...>
2017/01/31
SASADA Koichi <ko1@atdot.net> wrote:
[ruby-core:79264] [Ruby trunk Bug#13158] UNIXServer#closed? returns false after UNIXServer#close called
From:
nobu@...
Date:
2017-01-25 13:32:38 UTC
List:
ruby-core #79264
Issue #13158 has been updated by Nobuyoshi Nakada.
Description updated
Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED
----------------------------------------
Bug #13158: UNIXServer#closed? returns false after UNIXServer#close called
https://bugs.ruby-lang.org/issues/13158#change-62681
* Author: Satoshi TAGOMORI
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.5.0dev (2017-01-25 trunk 57420) [x86_64-linux]
* Backport: 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED
----------------------------------------
When I tried the simple script below, ruby trunk works unexpectedly:
```ruby
require 'socket'
server = UNIXServer.new('/tmp/yaaaay')
thread = Thread.new do
begin
while sock = server.accept
p(here: "accepted", sock: sock)
sock.close rescue nil
end
rescue => e
p(here: "rescue", closed: server.closed?, error: e)
end
end
sleep 1
server.close
sleep 1
File.delete('/tmp/yaaaay')
```
The output of this script is:
```
# ruby 2.5.0-dev on linux
vagrant@vagrant-ubuntu-trusty-64:/vagrant$ ruby -v
ruby 2.5.0dev (2017-01-25 trunk 57420) [x86_64-linux]
vagrant@vagrant-ubuntu-trusty-64:/vagrant$ ruby hoge.rb
{:here=>"rescue", :closed=>false, :error=>#<IOError: stream closed>}
# ruby 2.4.0 on linux
vagrant@vagrant-ubuntu-trusty-64:/vagrant$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
vagrant@vagrant-ubuntu-trusty-64:/vagrant$ ruby hoge.rb
{:here=>"rescue", :closed=>true, :error=>#<IOError: stream closed>}
# ruby 2.5.0-dev on osx
MBA:fluentd tagomoris$ ruby -v
ruby 2.5.0dev (2017-01-24 trunk 57413) [x86_64-darwin15]
MBA:fluentd tagomoris$ ruby hoge.rb
{:here=>"rescue", :closed=>true, :error=>#<Errno::EBADF: Bad file descriptor>}
# full list I tried is here: https://gist.github.com/tagomoris/5bc1b618c5196c693a7b096353eb57e4
```
Raised error class is not mine point. This script with ruby 2.5.0-dev on linux returns false for `server.closed?`.
When any errors are raised, we should check whether it's raised by intentional `sever.close` or not. But it doesn't work well on ruby 2.5.0 on linux.
Is it possible to fix this problem?
Note: When I added some more `p(here: "rescue", closed: server.closed?)` lines in rescue clause, these (2nd and later) puts "true".
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>