HBASE-20258 Shell hangs when scanning a disabled table

Signed-off-by: Mike Drob <mdrob@apache.org>
This commit is contained in:
Balazs Meszaros 2018-03-27 15:33:54 +02:00 committed by Mike Drob
parent 8014c5c3ac
commit 143ed0d19d
2 changed files with 14 additions and 0 deletions

View File

@ -116,6 +116,9 @@ module Shell
raise "Unknown table #{strs[0]}!" if strs.size == 1
raise "Unknown table #{args.first}!"
end
if cause.is_a?(org.apache.hadoop.hbase.TableNotEnabledException)
raise "Table #{args.first} is disabled!"
end
if cause.is_a?(org.apache.hadoop.hbase.UnknownRegionException)
raise "Unknown region #{args.first}!"
end

View File

@ -695,5 +695,16 @@ module Hbase
assert_equal(0, splits.size)
assert_equal([], splits)
end
define_test "scan should throw an exception on a disabled table" do
@test_table.disable
begin
assert_raise(RuntimeError) do
@test_table.scan
end
ensure
@test_table.enable
end
end
end
end