1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Stop Thread.new in DRb::TimerIdConv::TimerHolder2#on_gc

and add more stop_pool after stop_service
This commit is contained in:
Kazuhiro NISHIYAMA 2019-12-10 12:41:09 +09:00
parent 129c3216d9
commit 7be550d046
No known key found for this signature in database
GPG key ID: 262ED8DBB4222F7A
4 changed files with 18 additions and 1 deletions

View file

@ -1215,6 +1215,7 @@ module DRb
def kill
@thread.kill
@thread.join
end
def method_missing(msg, *arg, &blk)

View file

@ -42,6 +42,7 @@ class DRbService
server.stop_service
manager.instance_variable_get(:@queue)&.push(nil)
manager.instance_variable_get(:@thread)&.join
DRb::DRbConn.stop_pool
end
end

View file

@ -329,6 +329,7 @@ class TestDRbAnyToS < Test::Unit::TestCase
assert_match(/\A#<DRbTests::TestDRbAnyToS::BO:0x[0-9a-f]+>\z/, server.any_to_s(BO.new))
server.stop_service
server.thread.join
DRb::DRbConn.stop_pool
end
end
@ -344,6 +345,7 @@ class TestDRbTCP < Test::Unit::TestCase
client.close
server.stop_service
server.thread.join
DRb::DRbConn.stop_pool
end
end

View file

@ -12,6 +12,7 @@ module DRbObjectTest
def teardown
DRb.stop_service
DRb::DRbConn.stop_pool
end
def drb_eq(obj)
@ -43,7 +44,19 @@ class TestDRbObjectTimerIdConv < Test::Unit::TestCase
include DRbObjectTest
def setup
DRb.start_service(nil, nil, {:idconv => DRb::TimerIdConv.new})
@idconv = DRb::TimerIdConv.new
DRb.start_service(nil, nil, {:idconv => @idconv})
end
def teardown
super
# stop DRb::TimerIdConv::TimerHolder2#on_gc
@idconv.instance_eval do
@holder.instance_eval do
@expires = nil
end
end
GC.start
end
end