-
Notifications
You must be signed in to change notification settings - Fork 0
assert grpc call errors #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1485,9 +1485,9 @@ fn get_hostfunc( | |
| let mem = match caller.get_export("memory") { | ||
| Some(Extern::Memory(mem)) => mem, | ||
| _ => { | ||
| println!("Error: proxy_http_call cannot get export \"memory\""); | ||
| println!("Error: proxy_grpc_call cannot get export \"memory\""); | ||
| println!( | ||
| "[vm<-host] proxy_http_call(...) -> (return_token) return: {:?}", | ||
| "[vm<-host] proxy_grpc_call(...) -> (return_token) return: {:?}", | ||
| Status::InternalFailure | ||
| ); | ||
| return Status::InternalFailure as i32; | ||
|
|
@@ -1506,25 +1506,34 @@ fn get_hostfunc( | |
| println!( | ||
| "[vm->host] proxy_grpc_call(service={service}, service_name={service_name}, method_name={method_name}, initial_metadata={initial_metadata:?}, request={request:?}, timeout={timeout_milliseconds}"); | ||
|
|
||
| let token_id = match EXPECT.lock().unwrap().staged.get_expect_grpc_call( | ||
| service, | ||
| service_name, | ||
| method_name, | ||
| initial_metadata, | ||
| request, | ||
| timeout_milliseconds, | ||
| ) { | ||
| Some(expect_token) => expect_token, | ||
| None => 0, | ||
| }; | ||
|
|
||
| unsafe { | ||
| let return_token_add = mem.data_mut(&mut caller).get_unchecked_mut( | ||
| token_ptr as u32 as usize..token_ptr as u32 as usize + 4, | ||
| ); | ||
| return_token_add.copy_from_slice(&token_id.to_le_bytes()); | ||
| let call_result = EXPECT | ||
| .lock() | ||
| .unwrap() | ||
| .staged | ||
| .get_expect_grpc_call( | ||
| service, | ||
| service_name, | ||
| method_name, | ||
| initial_metadata, | ||
| request, | ||
| timeout_milliseconds, | ||
| ) | ||
| .unwrap_or(Ok(0)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You seem to change this for a
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So why the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It get rewrapped in an
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... other than when it isn't expected... |
||
|
|
||
| if let Ok(token_id) = call_result { | ||
alexsnaps marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| unsafe { | ||
| let return_token_add = mem.data_mut(&mut caller).get_unchecked_mut( | ||
| token_ptr as u32 as usize..token_ptr as u32 as usize + 4, | ||
| ); | ||
| return_token_add.copy_from_slice(&token_id.to_le_bytes()); | ||
| } | ||
| } | ||
|
|
||
| let call_status = match call_result { | ||
alexsnaps marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Ok(_) => Status::Ok, | ||
| Err(s) => s, | ||
| }; | ||
|
|
||
| // Default Function: | ||
| // Expectation: | ||
| println!( | ||
|
|
@@ -1536,7 +1545,7 @@ fn get_hostfunc( | |
| Status::Ok | ||
| ); | ||
| assert_ne!(get_status(), ExpectStatus::Failed); | ||
| return Status::Ok as i32; | ||
| return call_status as i32; | ||
| }, | ||
| )) | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.