We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
应用场景:表名table1,分库未分表 测试用例:select min(id) from table1 错误信息:NPE
错误分析: debug发现getResult做merge时子线程异步返回的resultset为null。
代码:com.dangdang.ddframe.rdb.sharding.executor.ExecutorEngine.getFutureResults用guava的Futures.get()阻塞式返回异步执行查询的resultset,怀疑该方法未像javadoc所声明的为阻塞方式。
修改该方法为显式阻塞,问题得到修复: private List getFutureResults(final Set<ListenableFuture> futures) { List result = new ArrayList(futures.size()); try { for (ListenableFuture future : futures) { result.add(future.get()); } } catch (final InterruptedException | ExecutionException ex) { throw new ShardingJdbcException(ex); } return result; }
The text was updated successfully, but these errors were encountered:
是我测试代码的问题,Futures.get()确实为阻塞,不存在上述问题。
Sorry, something went wrong.
No branches or pull requests
应用场景:表名table1,分库未分表
测试用例:select min(id) from table1
错误信息:NPE
错误分析:
debug发现getResult做merge时子线程异步返回的resultset为null。
代码:com.dangdang.ddframe.rdb.sharding.executor.ExecutorEngine.getFutureResults用guava的Futures.get()阻塞式返回异步执行查询的resultset,怀疑该方法未像javadoc所声明的为阻塞方式。
修改该方法为显式阻塞,问题得到修复:
private List getFutureResults(final Set<ListenableFuture> futures) {
List result = new ArrayList(futures.size());
try {
for (ListenableFuture future : futures) {
result.add(future.get());
}
} catch (final InterruptedException | ExecutionException ex) {
throw new ShardingJdbcException(ex);
}
return result;
}
The text was updated successfully, but these errors were encountered: