Skip to content

Commit

Permalink
Fix misspellings in code files (#1420)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksdmladenovic authored Oct 25, 2024
1 parent 6fcb3bb commit 6899467
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions nativelink-config/src/cas_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ pub enum EnvironmentSource {
/// (requested by the client).
timeout_millis,

/// A special file path will be provided that can be used to comminicate
/// A special file path will be provided that can be used to communicate
/// with the parent process about out-of-band information. This file
/// will be read after the command has finished executing. Based on the
/// contents of the file, the behavior of the result may be modified.
Expand Down Expand Up @@ -665,7 +665,7 @@ pub enum WorkerConfig {
pub struct GlobalConfig {
/// Maximum number of open files that can be opened at one time.
/// This value is not strictly enforced, it is a best effort. Some internal libraries
/// open files or read metadata from a files which do not obay this limit, however
/// open files or read metadata from a files which do not obey this limit, however
/// the vast majority of cases will have this limit be honored.
/// As a rule of thumb this value should be less than half the value of `ulimit -n`.
/// Any network open file descriptors is not counted in this limit, but is counted
Expand Down Expand Up @@ -696,7 +696,7 @@ pub struct GlobalConfig {
/// are collected at runtime (performance metrics) from being tallied. The
/// overhead of collecting metrics is very low, so this flag should only be
/// used if there is a very good reason to disable metrics.
/// This flag can be forcably set using the `NATIVELINK_DISABLE_METRICS` variable.
/// This flag can be forcibly set using the `NATIVELINK_DISABLE_METRICS` variable.
/// If the variable is set it will always disable metrics regardless of what
/// this flag is set to.
///
Expand Down
4 changes: 2 additions & 2 deletions nativelink-scheduler/src/simple_scheduler_state_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,9 +850,9 @@ where
async fn assign_operation(
&self,
operation_id: &OperationId,
worker_id_or_reason_for_unsassign: Result<&WorkerId, Error>,
worker_id_or_reason_for_unassign: Result<&WorkerId, Error>,
) -> Result<(), Error> {
let (maybe_worker_id, update) = match worker_id_or_reason_for_unsassign {
let (maybe_worker_id, update) = match worker_id_or_reason_for_unassign {
Ok(worker_id) => (
Some(worker_id),
UpdateOperationType::UpdateWithActionStage(ActionStage::Executing),
Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl Serialize for DigestInfo {
}
}

/// Custom deserializer for `DigestInfo` becaues the default Deserializer
/// Custom deserializer for `DigestInfo` because the default Deserializer
/// would try to decode the data as a byte array, but we use {hex}-{size}.
impl<'de> Deserialize<'de> for DigestInfo {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/src/digest_hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::common::DigestInfo;
use crate::origin_context::{ActiveOriginContext, OriginContext};
use crate::{fs, make_symbol, spawn_blocking};

// The symbol can be use to retrieve the active hasher function.
// The symbol can be used to retrieve the active hasher function.
// from an `OriginContext`.
make_symbol!(ACTIVE_HASHER_FUNC, DigestHasherFunc);

Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/src/fastcdc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl State {
/// In layman's terms this means we can take an input of unknown size and composition
/// and chunk it into smaller chunks with chunk boundaries that will be very similar
/// even when a small part of the file is changed. This use cases where a large file
/// (say 1G) has a few minor changes weather they byte inserts, deletes or updates
/// (say 1G) has a few minor changes whether they byte inserts, deletes or updates
/// and when running through this algorithm it will slice the file up so that under
/// normal conditions all the chunk boundaries will be identical except the ones near
/// the mutations.
Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl ResumeableFileSlot {

/// Utility function to read data from a handler and handles file descriptor
/// timeouts. Chunk size is based on the `buf`'s capacity.
/// Note: If the `handler` changes `buf`s capcity, it is responsible for reserving
/// Note: If the `handler` changes `buf`s capacity, it is responsible for reserving
/// more before returning.
pub async fn read_buf_cb<'b, T, F, Fut>(
&'b mut self,
Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/src/health_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub struct HealthRegistryBuilder {

/// Health registry builder that is used to build a health registry.
/// The builder provides creation, registering of health status indicators,
/// sub building scoped health registries and building the health registry.
/// sub-building scoped health registries and building the health registry.
/// `build()` should be called once for finalizing the production of a health registry.
impl HealthRegistryBuilder {
pub fn new(namespace: &str) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/src/known_platform_property_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ use crate::operation_state_manager::ClientStateManager;
pub trait KnownPlatformPropertyProvider:
ClientStateManager + Sync + Send + Unpin + RootMetricsComponent + 'static
{
// / Returns the platform property manager.
// Returns the platform property manager.
async fn get_known_properties(&self, instance_name: &str) -> Result<Vec<String>, Error>;
}
4 changes: 2 additions & 2 deletions nativelink-util/src/metrics_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ pub struct AsyncCounterWrapper {
pub successes: AtomicU64,
pub failures: AtomicU64,
pub drops: AtomicU64,
// Time spent in nano seconds in the future.
// Time spent in nanoseconds in the future.
// 64 bit address space gives ~584 years of nanoseconds.
pub sum_func_duration_ns: AtomicU64,
}
Expand Down Expand Up @@ -278,7 +278,7 @@ impl AsyncCounterWrapper {
}
}

/// Tracks an number.
/// Tracks a number.
#[derive(Default)]
pub struct Counter(AtomicU64);

Expand Down
4 changes: 2 additions & 2 deletions nativelink-util/src/operation_state_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub struct OperationFilter {
/// The digest of the action that the operation must have.
pub action_digest: Option<DigestInfo>,

/// The operation must have it's worker timestamp before this time.
/// The operation must have its worker timestamp before this time.
pub worker_update_before: Option<SystemTime>,

/// The operation must have been completed before this time.
Expand Down Expand Up @@ -160,6 +160,6 @@ pub trait MatchingEngineStateManager: Sync + Send + MetricsComponent {
async fn assign_operation(
&self,
operation_id: &OperationId,
worker_id_or_reason_for_unsassign: Result<&WorkerId, Error>,
worker_id_or_reason_for_unassign: Result<&WorkerId, Error>,
) -> Result<(), Error>;
}
16 changes: 8 additions & 8 deletions nativelink-util/src/origin_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ use tracing::{Instrument, Span};
use crate::background_spawn;

/// Make a symbol that represents a unique memory pointer that is
/// constant and choosen at compile time. This enables two modules
/// constant and chosen at compile time. This enables two modules
/// to use that memory location to reference data that lives in a
/// shared module without the two modules knowing about eachother.
/// For example, lets say we have a context that holds anonymous
/// shared module without the two modules knowing about each other.
/// For example, let's say we have a context that holds anonymous
/// data; we can use these symbols to let one module set the data
/// and tie the data to a symbol and another module read the data
/// with the symbol, without the two modules knowing about eachother.
/// with the symbol, without the two modules knowing about each other.
#[macro_export]
macro_rules! make_symbol {
($name:ident, $type:ident) => {
Expand Down Expand Up @@ -133,15 +133,15 @@ impl OriginContext {
}

/// Consumes the context and runs the given function with the context set
/// as the active context. When the function exists the context is restored
/// as the active context. When the function exits, the context is restored
/// to the previous global context.
#[inline]
pub fn run<T>(self, span: Span, func: impl FnOnce() -> T) -> T {
Arc::new(self).wrap(span, func)()
}

/// Wraps a function so when it is called the passed in context is set as
/// the active context and when the function exists the context is restored
/// the active context and when the function exits, the context is restored
/// to the previous global context.
#[inline]
fn wrap<T>(self: Arc<Self>, span: Span, func: impl FnOnce() -> T) -> impl FnOnce() -> T {
Expand All @@ -154,7 +154,7 @@ impl OriginContext {
}

/// Wraps a future so when it is called the passed in context is set as
/// the active context and when the future exists the context is restored
/// the active context and when the future exits, the context is restored
/// to the previous global context.
#[inline]
pub fn wrap_async<T>(
Expand Down Expand Up @@ -300,7 +300,7 @@ pin_project! {
let this = this.project();
// Note: If the future panics, the context will not be restored, so
// this is a best effort to provide access to our global context
// in the desturctors the event of a panic.
// in the destructors the event of a panic.
let _enter = this.context.take().map(OriginContext::enter);
// SAFETY: 1. `Pin::get_unchecked_mut()` is safe, because this isn't
// different from wrapping `T` in `Option` and calling
Expand Down
4 changes: 2 additions & 2 deletions nativelink-util/src/resource_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ enum State {
OptionalMetadata,
}

// Iterate backwards looking for "(compressed-)blobs", once found, move foward
// Iterate backwards looking for "(compressed-)blobs", once found, move forward
// populating the output struct. This recursive function utilises the stack to
// temporarly hold the reference to the previous item reducing the need for
// temporarily hold the reference to the previous item reducing the need for
// a heap allocation.
fn recursive_parse<'a>(
rparts: &mut impl Iterator<Item = &'a str>,
Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/src/store_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ pub trait SchedulerStore: Send + Sync + 'static {
}

/// A type that is used to let the scheduler store know what
/// index is beign requested.
/// index is being requested.
pub trait SchedulerIndexProvider {
/// Only keys inserted with this prefix will be indexed.
const KEY_PREFIX: &'static str;
Expand Down
2 changes: 1 addition & 1 deletion nativelink-util/tests/fastcdc_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async fn test_random_20mb_16k_chunks() -> Result<(), std::io::Error> {
}

#[nativelink_test]
async fn insert_garbage_check_boundarys_recover_test() -> Result<(), std::io::Error> {
async fn insert_garbage_check_boundaries_recover_test() -> Result<(), std::io::Error> {
let mut rand_data = {
let mut data = vec![0u8; 100_000];
let mut rng = SmallRng::seed_from_u64(1);
Expand Down
2 changes: 1 addition & 1 deletion nativelink-worker/src/local_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ use crate::worker_utils::make_supported_properties;
/// consider an error to have occurred.
const ACTIONS_IN_TRANSIT_TIMEOUT_S: f32 = 10.;

/// If we loose connection to the worker api server we will wait this many seconds
/// If we lose connection to the worker api server we will wait this many seconds
/// before trying to connect.
const CONNECTION_RETRY_DELAY_S: f32 = 0.5;

Expand Down
2 changes: 1 addition & 1 deletion nativelink-worker/src/running_actions_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const DEFAULT_HISTORICAL_RESULTS_STRATEGY: UploadCacheResultsStrategy =
#[allow(non_camel_case_types)]
#[derive(Debug, Deserialize)]
enum SideChannelFailureReason {
/// Task should be considered timedout.
/// Task should be considered timed out.
timeout,
}

Expand Down

0 comments on commit 6899467

Please sign in to comment.