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:
parent
129c3216d9
commit
7be550d046
4 changed files with 18 additions and 1 deletions
|
@ -1215,6 +1215,7 @@ module DRb
|
||||||
|
|
||||||
def kill
|
def kill
|
||||||
@thread.kill
|
@thread.kill
|
||||||
|
@thread.join
|
||||||
end
|
end
|
||||||
|
|
||||||
def method_missing(msg, *arg, &blk)
|
def method_missing(msg, *arg, &blk)
|
||||||
|
|
|
@ -42,6 +42,7 @@ class DRbService
|
||||||
server.stop_service
|
server.stop_service
|
||||||
manager.instance_variable_get(:@queue)&.push(nil)
|
manager.instance_variable_get(:@queue)&.push(nil)
|
||||||
manager.instance_variable_get(:@thread)&.join
|
manager.instance_variable_get(:@thread)&.join
|
||||||
|
DRb::DRbConn.stop_pool
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -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))
|
assert_match(/\A#<DRbTests::TestDRbAnyToS::BO:0x[0-9a-f]+>\z/, server.any_to_s(BO.new))
|
||||||
server.stop_service
|
server.stop_service
|
||||||
server.thread.join
|
server.thread.join
|
||||||
|
DRb::DRbConn.stop_pool
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -344,6 +345,7 @@ class TestDRbTCP < Test::Unit::TestCase
|
||||||
client.close
|
client.close
|
||||||
server.stop_service
|
server.stop_service
|
||||||
server.thread.join
|
server.thread.join
|
||||||
|
DRb::DRbConn.stop_pool
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ module DRbObjectTest
|
||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
DRb.stop_service
|
DRb.stop_service
|
||||||
|
DRb::DRbConn.stop_pool
|
||||||
end
|
end
|
||||||
|
|
||||||
def drb_eq(obj)
|
def drb_eq(obj)
|
||||||
|
@ -43,7 +44,19 @@ class TestDRbObjectTimerIdConv < Test::Unit::TestCase
|
||||||
include DRbObjectTest
|
include DRbObjectTest
|
||||||
|
|
||||||
def setup
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue