Skip to content

Conversation

@yangrudan
Copy link
Contributor

… from getting stuck.

通过增加命令行的超时机制, 避免请求无法返回时出现的卡死.

#34

pub async fn cli_main(args: Vec<String>) -> Result<()> {
let _ = env_logger::try_init_from_env(Env::new().filter(ENV_PROBING_LOGLEVEL));
cli::Cli::parse_from(args).run().await
match timeout(Duration::from_secs(10), cli::Cli::parse_from(args).run()).await {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有些命令的执行时间会比较长,比如REPL命令不会主动结束,这个超时可能会导致REPL这类命令出问题。建议缩短超时机制的范围,只对部分子命令生效

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哦哦, 没考虑到repl, 不过ctypes换成pyO3是不是导致了GIL锁的问题呀?我不太确定

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

理论上应该不会

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的堆栈显示在等待GIL锁(第一个红框框take_gil) ?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants