Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions Backend/src/plugin_runtime/node_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ impl NodeRpcProcess {
self.next_request_id = self
.next_request_id
.checked_add(1)
.ok_or_else(|| "rpc request id overflow".to_string())?;
.ok_or_else(|| {
format!(
"plugin '{}' exhausted RPC request IDs after {} calls; restart of plugin runtime required",
plugin_id, request_id
)
})?;

let request = RpcRequest {
jsonrpc: "2.0".to_string(),
Expand Down Expand Up @@ -536,7 +541,13 @@ impl NodePluginRuntimeInstance {
let config_value = if config.is_empty() {
Value::Object(serde_json::Map::new())
} else {
serde_json::from_slice(config).unwrap_or_else(|_| Value::Object(serde_json::Map::new()))
match serde_json::from_slice(config) {
Ok(v) => v,
Err(e) => {
log::warn!("Failed to parse VCS open config as JSON, using empty object instead: {}", e);
Value::Object(serde_json::Map::new())
}
}
};
let result: OpenSessionResponse = self.rpc_call(
Methods::VCS_OPEN,
Expand Down
Loading