You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #774 for implementing MoveFunctionCall for the RPC Server, the solution is to introduce another tokio Runtime.
Then it is discovered that the RPC server may not be able to directly capture and process an error. The phenomenon is that the call RPC returns a blank, but there is an error log in the console output.
The tokio Runtime implemented in AggrateService, both AggrateService and RPCService will occur the above situation.
Exception case
let coin_store_handle = coin_module.coin_store_handle(account_addr)?.except("Coin store handle does not exist");
error stack
thread 'tokio-runtime-worker' panicked at 'Coin store handle does not exist', crates/rooch-rpc-server/src/service/aggregate_service.rs:73:31
Normal case after rewriting
let coin_store_handle = coin_module.coin_store_handle(account_addr)?;
// Handle error due to `coin_store_handle` executed in another tokio Runtime
let coin_store_handle = match coin_store_handle {
Some(v) => v,
None => anyhow::bail!("Coin store handle does not exist"),
};
It is determined that it is not caused by the introduction of dual tikio runtime. The same problem existed in the earlier RPC Server. The reason is that methods such as expect or unwrap will cause panic exceptions, causing the program to exit directly.
baichuan3
changed the title
[RPC] RPC handle error after introduce another tokio Runtime
[RPC] RPC server handle panic exceptions to output error msg
Sep 17, 2023
In #774 for implementing MoveFunctionCall for the RPC Server, the solution is to introduce another tokio Runtime.
Then it is discovered that the RPC server may not be able to directly capture and process an error. The phenomenon is that the call RPC returns a blank, but there is an error log in the console output.
The tokio Runtime implemented in AggrateService, both AggrateService and RPCService will occur the above situation.
Exception case
error stack
Normal case after rewriting
Relative #817
The text was updated successfully, but these errors were encountered: