Skip to content

Conversation

@dgohman-fastly
Copy link
Contributor

Changes:

  • inspect-options moved from http-req to security.
  • Some error types are renamed:
    • bad-handle is now auxiliary-error
    • optional-none is now cannot-read
  • log.write is now infallible.
  • cache.replace-entry is now a separate resource rather than a type alias.

Changes:
 - `inspect-options` moved from `http-req` to `security`.
 - Some error types are renamed:
    - `bad-handle` is now `auxiliary-error`
    - `optional-none` is now `cannot-read`
 - `log.write` is now infallible.
 - `cache.replace-entry` is now a separate resource rather than a
   type alias.
Err(e) => e.into(),
endpoint_handle.write(msg);
unsafe {
*main_ptr!(nwritten_out) = msg_len;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the error case, nwritten_out can be less than msg_len?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WIT interface also changes log.write to be infallible, so there is no error case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay. This is only returns to witx. The final wit doesn't return nwritten to the user. All good.

// rather than bubbling it up through the log API.
match endpoint.write_entry(&msg) {
Ok(()) => {}
Err(err) => tracing::error!("Error writing log message: {:?}", err),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is a buffer overflow, is it possible that we didn't write the whole msg?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible that we didn't write all the bytes to the ultimate destination, but applications aren't in a position to do anything useful about it. So instead, we log it, using tracing::error, where the error will hopefully be seen by the person running viceroy, who is in a better position to do something about it.

@dgohman-fastly dgohman-fastly merged commit ce9a240 into main Oct 23, 2025
13 checks passed
@dgohman-fastly dgohman-fastly deleted the dgohman-fastly/update branch October 23, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants