Skip to content

Centralize program branding helpers#1329

Merged
oferchen merged 2 commits into
masterfrom
prepare-for-production-release
Oct 28, 2025
Merged

Centralize program branding helpers#1329
oferchen merged 2 commits into
masterfrom
prepare-for-production-release

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • centralize the upstream and oc-* program names behind the branding module with doc-tested accessors
  • expose convenience helpers for building version metadata for each binary and cover them with unit tests

Testing

  • cargo test -p rsync-core branding
  • cargo test -p rsync-core version_metadata_for_program_overrides_program_name

https://chatgpt.com/codex/tasks/task_e_69009195ee08832384297ba41d969102

@oferchen oferchen merged commit 25b0617 into master Oct 28, 2025
@oferchen oferchen deleted the prepare-for-production-release branch October 28, 2025 09:57
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +99 to +120
/// Returns the canonical client program name for upstream-compatible binaries.
#[must_use]
pub const fn client_program_name() -> &'static str {
CLIENT_PROGRAM_NAME
}

/// Returns the canonical daemon program name for upstream-compatible binaries.
#[must_use]
pub const fn daemon_program_name() -> &'static str {
DAEMON_PROGRAM_NAME
}

/// Returns the branded client program name exposed as `oc-rsync`.
#[must_use]
pub const fn oc_client_program_name() -> &'static str {
OC_CLIENT_PROGRAM_NAME
}

/// Returns the branded daemon program name exposed as `oc-rsyncd`.
#[must_use]
pub const fn oc_daemon_program_name() -> &'static str {
OC_DAEMON_PROGRAM_NAME
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0 Badge Remove duplicate branding accessors and undefined constants

The new helpers expose client_program_name() and daemon_program_name() but both return CLIENT_PROGRAM_NAME/DAEMON_PROGRAM_NAME, constants that are not defined anywhere in the crate. In the same block, oc_client_program_name() and oc_daemon_program_name() are defined a second time, duplicating the existing functions above. These missing constants and duplicate definitions prevent rsync-core from compiling. Reuse the existing UPSTREAM_* constants (or rename the original helpers) instead of referencing non‑existent names, and avoid redeclaring the oc_* accessors.

Useful? React with 👍 / 👎.

Comment on lines 351 to +370
pub const fn version_metadata() -> VersionMetadata {
version_metadata_for_program(PROGRAM_NAME)
version_metadata_for_program(client_program_name())
}

/// Returns metadata configured for the upstream-compatible `rsync` daemon banner.
#[must_use]
pub const fn daemon_version_metadata() -> VersionMetadata {
version_metadata_for_program(daemon_program_name())
}

/// Returns metadata configured for the branded `oc-rsync` client banner.
#[must_use]
pub const fn oc_version_metadata() -> VersionMetadata {
version_metadata_for_program(oc_client_program_name())
}

/// Returns metadata configured for the branded `oc-rsyncd` daemon banner.
#[must_use]
pub const fn oc_daemon_version_metadata() -> VersionMetadata {
version_metadata_for_program(oc_daemon_program_name())
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P0 Badge Qualify branding helpers used by version metadata

The new metadata functions invoke client_program_name(), daemon_program_name(), oc_client_program_name(), and oc_daemon_program_name() directly, but these functions live in the branding module and are not imported into version.rs. As written, the calls refer to undefined functions and will fail to compile even after the branding module builds. Reference them as branding::client_program_name() (and the other variants) or add explicit use crate::branding::{…} statements before calling them.

Useful? React with 👍 / 👎.

oferchen added a commit that referenced this pull request Mar 21, 2026
Replace Mutex<Vec<Vec<u8>>> with crossbeam_queue::ArrayQueue for
lock-free concurrent buffer pool access. ArrayQueue uses CAS operations
instead of mutex locking, eliminating contention on hot paths in
parallel_checksum.rs (rayon workers) and execute.rs (file transfer).

- pop() returns None when empty (allocate fresh buffer)
- push() returns Err when full (drop excess buffer)
- No mutex poisoning possible
- crossbeam-queue already proven in crates/transfer/src/pipeline/spsc.rs

Closes #1329
oferchen added a commit that referenced this pull request Mar 22, 2026
Replace Mutex<Vec<Vec<u8>>> with crossbeam_queue::ArrayQueue for
lock-free concurrent buffer pool access. ArrayQueue uses CAS operations
instead of mutex locking, eliminating contention on hot paths in
parallel_checksum.rs (rayon workers) and execute.rs (file transfer).

- pop() returns None when empty (allocate fresh buffer)
- push() returns Err when full (drop excess buffer)
- No mutex poisoning possible
- crossbeam-queue already proven in crates/transfer/src/pipeline/spsc.rs

Closes #1329
oferchen added a commit that referenced this pull request Mar 22, 2026
Replace Mutex<Vec<Vec<u8>>> with crossbeam_queue::ArrayQueue for
lock-free concurrent buffer pool access. ArrayQueue uses CAS operations
instead of mutex locking, eliminating contention on hot paths in
parallel_checksum.rs (rayon workers) and execute.rs (file transfer).

- pop() returns None when empty (allocate fresh buffer)
- push() returns Err when full (drop excess buffer)
- No mutex poisoning possible
- crossbeam-queue already proven in crates/transfer/src/pipeline/spsc.rs

Closes #1329
oferchen added a commit that referenced this pull request Mar 22, 2026
…2923)

Replace Mutex<Vec<Vec<u8>>> with crossbeam_queue::ArrayQueue for
lock-free concurrent buffer pool access. ArrayQueue uses CAS operations
instead of mutex locking, eliminating contention on hot paths in
parallel_checksum.rs (rayon workers) and execute.rs (file transfer).

- pop() returns None when empty (allocate fresh buffer)
- push() returns Err when full (drop excess buffer)
- No mutex poisoning possible
- crossbeam-queue already proven in crates/transfer/src/pipeline/spsc.rs

Closes #1329
oferchen added a commit that referenced this pull request May 1, 2026
…2923)

Replace Mutex<Vec<Vec<u8>>> with crossbeam_queue::ArrayQueue for
lock-free concurrent buffer pool access. ArrayQueue uses CAS operations
instead of mutex locking, eliminating contention on hot paths in
parallel_checksum.rs (rayon workers) and execute.rs (file transfer).

- pop() returns None when empty (allocate fresh buffer)
- push() returns Err when full (drop excess buffer)
- No mutex poisoning possible
- crossbeam-queue already proven in crates/transfer/src/pipeline/spsc.rs

Closes #1329
oferchen added a commit that referenced this pull request May 5, 2026
…2923)

Replace Mutex<Vec<Vec<u8>>> with crossbeam_queue::ArrayQueue for
lock-free concurrent buffer pool access. ArrayQueue uses CAS operations
instead of mutex locking, eliminating contention on hot paths in
parallel_checksum.rs (rayon workers) and execute.rs (file transfer).

- pop() returns None when empty (allocate fresh buffer)
- push() returns Err when full (drop excess buffer)
- No mutex poisoning possible
- crossbeam-queue already proven in crates/transfer/src/pipeline/spsc.rs

Closes #1329
oferchen added a commit that referenced this pull request May 7, 2026
Propose promoting the single-slot thread_local cache (#1329) into a
fixed-depth per-thread cache to keep most acquire/return cycles off the
shared ArrayQueue, with overflow falling through to the existing pool.
Documents the idle-memory trade-off and cites the sharded-queue
alternative in #1271 as fallback.
oferchen added a commit that referenced this pull request May 18, 2026
Propose promoting the single-slot thread_local cache (#1329) into a
fixed-depth per-thread cache to keep most acquire/return cycles off the
shared ArrayQueue, with overflow falling through to the existing pool.
Documents the idle-memory trade-off and cites the sharded-queue
alternative in #1271 as fallback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant