FISCO-BCOS / FISCO-BCOS/java-sdk

合约调用后目前没法做到BcosSDK优雅退出

Open
#750 1 comment 0 reactions 0 assignees View on GitHub
bug v2.9.0
Dominant language
Java
Stars
58
Forks
62
PR merge metrics
No merged PRs in 30d

Description

SDK版本:2.9.0
问题描述:合约加载并调用后,使用BcosSDK的stopAll方法没法实现优雅退出。

![image](https://user-images.githubusercontent.com/16771888/229081238-6fff54a1-8fe4-4c87-9227-ed1e5ac121e6.png)

该线程来自于合约创建时Contract构建器中EventSubscribe变量生成的线程池;

目前暂时用下述方式实现优雅退出:
Field field = Contract.class.getDeclaredField("eventSubscribe");
field.setAccessible(true);
EventSubscribe eventSubscribe = (EventSubscribe) field.get(合约对象);
eventSubscribe.stop();

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.