Skip to content
New issue

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

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

Open
599019643 opened this issue Mar 31, 2023 · 1 comment
Open

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

599019643 opened this issue Mar 31, 2023 · 1 comment
Labels
bug Something isn't working v2.9.0

Comments

@599019643
Copy link

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

image

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

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

@kyonRay
Copy link
Member

kyonRay commented Jul 4, 2023

感谢提出issue,这里应该是要手动停止event订阅监听,BcosSDK的stopAll不能及时释放。我们会考虑加上sdk停止时停止所有event监听线程。

@kyonRay kyonRay added the v2.9.0 label Jul 4, 2023
@kyonRay kyonRay added the bug Something isn't working label Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2.9.0
Projects
None yet
Development

No branches or pull requests

2 participants