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
Make max_bytes_per_stream optional in config #474
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 10 files reviewed, all discussions resolved (waiting on @adam-singer)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 10 of 10 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @allada)
nativelink-config/src/cas_server.rs
line 126 at r1 (raw file):
/// 16KiB - 64KiB is optimal. /// /// Defaults: 64Kib
nit: 64Kib
-> 64KiB
nativelink-config/src/cas_server.rs
line 128 at r1 (raw file):
/// Defaults: 64Kib #[serde(default, deserialize_with = "convert_numeric_with_shellexpand")] pub max_bytes_per_stream: usize,
What happens with serialization here if parses for a size larger than machine architecture (given usize is machine size specific)?
It does seem the least bad choice to keep ubiquitous between specific size, wondering if configuration mishaps could happen here (and think probably very low)
nativelink-service/src/bytestream_server.rs
line 176 at r1 (raw file):
stores.insert(instance_name.to_string(), store); } let max_bytes_per_stream = if config.max_bytes_per_stream == 0 {
Are there any maximum value constraints that we should guard here on? A size that might have the opposite regardless of situation?
Defaults "max_bytes_per_stream" to 64Kib in config file.
4cb0679
to
bb5cbb3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 9 of 10 files reviewed, 1 unresolved discussion (waiting on @adam-singer)
nativelink-config/src/cas_server.rs
line 126 at r1 (raw file):
Previously, adam-singer (Adam Singer) wrote…
nit:
64Kib
->64KiB
Done.
nativelink-config/src/cas_server.rs
line 128 at r1 (raw file):
Previously, adam-singer (Adam Singer) wrote…
What happens with serialization here if parses for a size larger than machine architecture (given usize is machine size specific)?
It does seem the least bad choice to keep ubiquitous between specific size, wondering if configuration mishaps could happen here (and think probably very low)
I'm pretty sure it'll panic at parse time. Rust has undefined behavior protection even at runtime (in theory).
nativelink-service/src/bytestream_server.rs
line 176 at r1 (raw file):
Previously, adam-singer (Adam Singer) wrote…
Are there any maximum value constraints that we should guard here on? A size that might have the opposite regardless of situation?
In theory the maximum is how much ram you have. This is a config value, so it's generally considered a "safe" variable since it's a config set by the server and not a property sent by a user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dismissed @adam-singer from a discussion.
Reviewable status: 9 of 10 files reviewed, all discussions resolved (waiting on @adam-singer)
Defaults "max_bytes_per_stream" to 64Kib in config file.
This change is