Skip to content
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

fix: multiplex panic #222

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion volo-thrift/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "volo-thrift"
version = "0.7.1"
version = "0.7.2"
edition.workspace = true
homepage.workspace = true
repository.workspace = true
Expand Down
3 changes: 1 addition & 2 deletions volo-thrift/src/codec/default/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ impl<E: ZeroCopyEncoder, W: AsyncWrite + Unpin + Send + Sync + 'static> Encoder
cx.stats_mut().set_write_size(real_size);

let write_result = (|| async {
self.linked_bytes.reset();
// then we reserve the size of the message in the linked bytes
self.linked_bytes.reserve(malloc_size);
// after that, we encode the message into the linked bytes
Expand All @@ -160,8 +161,6 @@ impl<E: ZeroCopyEncoder, W: AsyncWrite + Unpin + Send + Sync + 'static> Encoder
// put write end here so we can also record the time of encode error
cx.stats_mut().record_write_end_at();

// finally, don't forget to reset the linked bytes
self.linked_bytes.reset();
match write_result {
Ok(()) => Ok(()),
Err(mut e) => {
Expand Down
Loading