jiang he created HBASE-30247:
--------------------------------
Summary: Negative hbase.rpc.timeout causes RuntimeException during
batch Put instead of early configuration validation
Key: HBASE-30247
URL: https://issues.apache.org/jira/browse/HBASE-30247
Project: HBase
Issue Type: Bug
Affects Versions: 2.5.14
Environment: ## Environment
- HBase version: 2.5.14
- Java: OpenJDK 11
- Mode: local standalone HBase
- OS: Linux / WSL2
Reporter: jiang he
When `hbase.rpc.timeout` is configured as a negative value, HBase can start
successfully, but a normal client batch Put
fails at runtime with a `RuntimeException`.
This looks like an invalid configuration value is not validated early. The
failure is only exposed later in the client
API path.
## Reproducer
Use the following `hbase-site.xml` entries:
```xml
<configuration>
<property>
<name>hbase.rootdir</name>
<value>/tmp/hbase-tmp</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>false</value>
</property>
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
</property>
<property>
<name>hbase.rpc.timeout</name>
<value>-1</value>
</property>
<property>
<name>hbase.client.operation.timeout</name>
<value>1200000</value>
</property>
</configuration>
Then start HBase and run a client workload that performs a batch Put.
In my test, the client inserted several rows successfully first, then failed
when executing batch Put.
Actual result
The client API fails with:
java.lang.RuntimeException: The rpc timeout must be bigger than zero,current
value is-1
at
org.apache.hadoop.hbase.client.AsyncProcess.checkTimeout(AsyncProcess.java:421)
at
org.apache.hadoop.hbase.client.AsyncProcess.checkRpcTimeout(AsyncProcess.java:432)
at
org.apache.hadoop.hbase.client.AsyncProcess.checkTask(AsyncProcess.java:389)
at
org.apache.hadoop.hbase.client.AsyncProcess.submit(AsyncProcess.java:205)
at org.apache.hadoop.hbase.client.HTable.batch(HTable.java:464)
at org.apache.hadoop.hbase.client.HTable.put(HTable.java:578)
Expected result
HBase should either:
1. reject the invalid negative hbase.rpc.timeout during
configuration/startup, or
2. fall back to a safe default, or
3. throw a clearer configuration error before normal client operations run.
A normal API operation should not fail later with an unchecked
RuntimeException caused by an invalid timeout value.
Notes
The failure was found by configuration fuzzing.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)