aliyun / aliyun-tablestore-java-sdk

Aliyun TableStore(原OTS) JAVA SDK
https://www.aliyun.com/product/ots/
Apache License 2.0
54 stars 26 forks source link

怎么检查otsclient是否处于shutdown状态 #25

Open zhonghongfly opened 3 years ago

zhonghongfly commented 3 years ago

java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED at org.apache.http.util.Asserts.check(Asserts.java:46) at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRunning(CloseableHttpAsyncClientBase.java:90) at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:123) at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:68) at com.alicloud.openservices.tablestore.core.http.AsyncServiceClient.asyncSendRequest(AsyncServiceClient.java:150) at com.alicloud.openservices.tablestore.core.OperationLauncher.asyncInvokePost(OperationLauncher.java:152) at com.alicloud.openservices.tablestore.core.BatchGetRowLauncher.fire(BatchGetRowLauncher.java:63) at com.alicloud.openservices.tablestore.InternalClient.batchGetRow(InternalClient.java:586) at com.alicloud.openservices.tablestore.SyncClient.batchGetRow(SyncClient.java:273)

怎么检查otsclient是否处于shutdown状态???

activeThomas commented 1 year ago

java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED at org.apache.http.util.Asserts.check(Asserts.java:46) at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRunning(CloseableHttpAsyncClientBase.java:90) at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:123) at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:68) at com.alicloud.openservices.tablestore.core.http.AsyncServiceClient.asyncSendRequest(AsyncServiceClient.java:150) at com.alicloud.openservices.tablestore.core.OperationLauncher.asyncInvokePost(OperationLauncher.java:152) at com.alicloud.openservices.tablestore.core.BatchGetRowLauncher.fire(BatchGetRowLauncher.java:63) at com.alicloud.openservices.tablestore.InternalClient.batchGetRow(InternalClient.java:586) at com.alicloud.openservices.tablestore.SyncClient.batchGetRow(SyncClient.java:273)

怎么检查otsclient是否处于shutdown状态???

这个问题解决了吗?

zhonghongfly commented 1 year ago

java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED at org.apache.http.util.Asserts.check(Asserts.java:46) at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRunning(CloseableHttpAsyncClientBase.java:90) at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:123) at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:68) at com.alicloud.openservices.tablestore.core.http.AsyncServiceClient.asyncSendRequest(AsyncServiceClient.java:150) at com.alicloud.openservices.tablestore.core.OperationLauncher.asyncInvokePost(OperationLauncher.java:152) at com.alicloud.openservices.tablestore.core.BatchGetRowLauncher.fire(BatchGetRowLauncher.java:63) at com.alicloud.openservices.tablestore.InternalClient.batchGetRow(InternalClient.java:586) at com.alicloud.openservices.tablestore.SyncClient.batchGetRow(SyncClient.java:273)

怎么检查otsclient是否处于shutdown状态???

这个问题解决了吗?

源码没有暴露方法来判断,目前的做法是每隔5s获取表结构信息,捕获异常,发生异常时,销毁连接,建立新的连接,最大限度保证业务可用