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(torture): handle large overflow values #711

Merged
merged 1 commit into from
Jan 23, 2025
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
11 changes: 10 additions & 1 deletion torture/src/supervisor/comms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,16 @@ impl RequestResponse {
wr_stream.send(Envelope { reqno, message }).await?;
drop(wr_stream);

let message = timeout(self.shared.timeout, rx).await??;
// TODO: Spawning a blocking task to handle the reception of the message
// in the one shot channel is a workaround to make it possible to handle
// large messages. Using the standard `timeout(self.shared.timeout, rx).await??;`
// does not work, it hangs when the expected value to be received is larger than 15KiB.
let message = timeout(
self.shared.timeout,
tokio::task::spawn_blocking(|| rx.blocking_recv()),
)
.await???;

Ok(message)
}

Expand Down
7 changes: 1 addition & 6 deletions torture/src/supervisor/workload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,7 @@ impl WorkloadState {
// - Different power of two sizes.
// - Change it to be a non-even.
let len = if self.rng.gen_bool(self.biases.overflow) {
// TODO: handle multiple overflow page scenario.
// Currently, using a value that is too large causes the channel to hang
// when the agent is responding with the queried value.
// However MAX_LEAF_VALUE_SIZE is 1332 thus 2000 is enough
// to test simple overflow values where only one additional page is used.
2000
32 * 1024
} else {
32
};
Expand Down
Loading