Skip to content

Commit 495d934

Browse files
Progress
1 parent 8b58b00 commit 495d934

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

sdk-core/src/main/rust/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk-core/src/main/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77
crate-type = ["cdylib"]
88

99
[dependencies]
10-
restate-sdk-shared-core = { git = "https://github.com/restatedev/sdk-shared-core", branch = "main", features = ["tracing_pretty"] }
10+
restate-sdk-shared-core = { git = "https://github.com/restatedev/sdk-shared-core", rev = "ea9e3bbc1fa1194be624b04de514d9d7d5dfee50", features = ["tracing_pretty"] }
1111
bytes = "1"
1212
serde = { version = "1", features = ["derive"] }
1313
serde_bytes = "0.11"

sdk-core/src/main/rust/src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use bytes::Bytes;
1616
use restate_sdk_shared_core::{
1717
AttachInvocationTarget, AwaitResponse, CoreVM, Error, Header, HeaderMap, NonEmptyValue,
1818
NotificationHandle, PayloadOptions, ResponseHead, RetryPolicy, RunExitResult, State,
19-
TakeOutputResult, Target, TerminalFailure, UnresolvedFuture, VMOptions, Value, Version, VM,
19+
TakeOutputResult, Target, TerminalFailure, UnresolvedFuture, VMOptions, Value, VM,
2020
};
2121
use serde::{Deserialize, Serialize};
2222
use std::borrow::Cow;
@@ -273,12 +273,15 @@ fn vm_is_ready_to_execute(rc_vm: &Rc<RefCell<WasmVM>>) -> IsReadyReturn {
273273
#[export_name = "vm_state"]
274274
pub unsafe extern "C" fn _vm_state(vm_pointer: *const RefCell<WasmVM>) -> u32 {
275275
let rc_vm = vm_ptr_to_rc(vm_pointer);
276-
let state: State = tracing::dispatcher::with_default(&tracing::Dispatch::none(), || {
277-
VM::state(&rc_vm.borrow().vm)
278-
});
276+
// We need to make sure we don't log stuff here, because this method is called by the java logger
277+
let state = tracing::dispatcher::with_default(&tracing::Dispatch::none(), || vm_state(&rc_vm));
279278
state as u8 as u32
280279
}
281280

281+
fn vm_state(rc_vm: &Rc<RefCell<WasmVM>>) -> State {
282+
VM::state(&rc_vm.borrow().vm)
283+
}
284+
282285
#[export_name = "vm_do_progress"]
283286
pub unsafe extern "C" fn _vm_do_progress(
284287
vm_pointer: *const RefCell<WasmVM>,

0 commit comments

Comments
 (0)