ruby-changes:65803
From: Kazuhiro <ko1@a...>
Date: Tue, 6 Apr 2021 16:03:43 +0900 (JST)
Subject: [ruby-changes:65803] 31ba817887 (master): Try to fix Leaked file descriptor
https://git.ruby-lang.org/ruby.git/commit/?id=31ba817887 From 31ba81788729944705e9f666b52c5ca4990c311d Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> Date: Tue, 6 Apr 2021 16:02:24 +0900 Subject: Try to fix Leaked file descriptor https://github.com/ruby/ruby/runs/2274767991?check_suite_focus=true#step:15:118 ``` Leaked file descriptor: DRbTests::TestDRbTCP#test_immediate_close: 7 : #<TCPServer:fd 7, AF_INET, 0.0.0.0, 42451> Leaked file descriptor: DRbTests::TestDRbTCP#test_immediate_close: 9 : #<IO:fd 9> Leaked file descriptor: DRbTests::TestDRbTCP#test_immediate_close: 10 : #<IO:fd 10> ``` --- test/drb/test_drb.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/drb/test_drb.rb b/test/drb/test_drb.rb index 47b2966..1024618 100644 --- a/test/drb/test_drb.rb +++ b/test/drb/test_drb.rb @@ -342,7 +342,9 @@ class TestDRbTCP < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/drb/test_drb.rb#L342 socket.close client = DRb::DRbTCPSocket.new(server.uri, socket) assert client - client.close + ensure + client&.close + socket&.close server.stop_service server.thread.join DRb::DRbConn.stop_pool -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/