Skip to content

Commit

Permalink
Merge pull request #1579 from Phala-Network/connect-sidevm-rcu
Browse files Browse the repository at this point in the history
pruntime: Allow HTTP proxy to sidevm when syncing chain state
  • Loading branch information
kvinwang authored May 11, 2024
2 parents 9a91c53 + eed14f3 commit 3bf0a5e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/phactory/src/prpc_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,7 @@ impl<Platform: pal::Platform> RpcService<Platform> {
let guard = self.phactory.lock().unwrap();
debug!(target: "phactory::lock", "Locked phactory");
if !allow_rcu && guard.rcu_dispatching {
warn!(target: "phactory::lock", "RCU in progress, returning error");
return Err(from_display(
"RCU in progress, please try the request again later",
));
Expand Down
2 changes: 1 addition & 1 deletion standalone/pruntime/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub(crate) async fn ecall_connect_sidevm(
let contract_id = hex::decode(id.trim_start_matches("0x"))
.map_err(|err| (Status::BadRequest, err.to_string()))?;
let Some(command_tx) = APPLICATION
.lock_phactory(false, false)
.lock_phactory(true, false)
.map_err(|err| (Status::InternalServerError, err.to_string()))?
.sidevm_command_sender(&contract_id)
else {
Expand Down

0 comments on commit 3bf0a5e

Please sign in to comment.