Repository navigation
(MOT-4598) fix(queue): keep the engine-provider connection out of the III_WORKER_NAME override #967
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
Closed
ytallo
wants to merge
1
commit into
main
from
ytallolayon/mot-4598-queue-reserved-engine-provider-connection-self-conflicts
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
🔎 Supported by static analysis
🏁 Script executed:
Repository: iii-hq/workers
Length of output: 233
🏁 Script executed:
Repository: iii-hq/workers
Length of output: 34659
🏁 Script executed:
Repository: iii-hq/workers
Length of output: 34508
🌐 Web query:
iii-sdk 0.22.1-alpha.25 Rust register_worker III_WORKER_NAME source💡 Result:
In the iii-sdk (including version 0.22.1-alpha.25), the III_WORKER_NAME environment variable is used to automatically propagate the worker name to the SDKs [1][2]. When running a managed worker (e.g., via iii-worker), the system automatically injects the name defined in the configuration (e.g., config.yaml) into the environment as III_WORKER_NAME [1][3]. The Rust SDK (along with Node.js and Python SDKs) is designed to default its reported worker name to this environment variable if no explicit name is provided in the InitOptions [1]. Key details regarding this behavior: - Automatic Propagation: If your worker code does not explicitly set a name in the InitOptions, the SDK will automatically read the value from III_WORKER_NAME [1]. - Precedence: If you explicitly set a worker name within your code—typically by passing a WorkerMetadata object with a name field into the InitOptions passed to register_worker—that explicit name will take precedence over the III_WORKER_NAME environment variable [4][1]. - Usage: This mechanism ensures that workers match their configuration entry names rather than defaulting to generic identifiers like hostname:pid, which helps maintain accurate worker status and discovery within the iii engine [1][5]. To explicitly set a name in Rust if you need to override or verify it, you can use the following pattern [4][6]: use iii_sdk::{register_worker, InitOptions, WorkerMetadata}; let worker = register_worker( "ws://localhost:49134", InitOptions { metadata: Some(WorkerMetadata { name: "my-custom-worker-name".into,..Default::default }),..Default::default },);
Citations:
🏁 Script executed:
Repository: iii-hq/workers
Length of output: 226
🌐 Web query:
site:github.com/iii-hq/iii "III_WORKER_NAME" "register_worker" Rust💡 Result:
The term III_WORKER_NAME is an environment variable or configuration identifier used within the III (iii-hq) ecosystem to identify worker processes [1]. In this context, the register_worker function is used to register a worker with the III engine [1]. When a worker process starts—or when a CLI command such as iii trigger is executed—the system uses register_worker to establish the worker's identity and metadata within the engine [1]. Key details regarding this process include: - Worker Identification: Worker names are typically configured to allow the engine to track status and metadata [1]. If a specific name is not provided, the SDK may apply fallback naming conventions [1]. - CLI Usage: When using iii trigger, the command explicitly manages worker registration to avoid identity collisions with managed worker containers [1]. For instance, CLI-based workers are often identified with specific prefixes (e.g., iii-cli:trigger) to distinguish them from standard service workers [1]. - Telemetry: The registration flow is integrated with heartbeat and telemetry mechanisms, ensuring the engine can monitor the state and usage of workers [1]. If you are developing or debugging a worker in the III environment, ensure that your environment variables are correctly set and that any custom CLI invocations adhere to the registration expectations defined in the engine's telemetry and worker modules [1].
Citations:
🏁 Script executed:
Repository: iii-hq/workers
Length of output: 50371
🏁 Script executed:
Repository: iii-hq/workers
Length of output: 50373
Replace the global environment mutation with a per-registration worker-name override.
register_workerstarts an SDK connection thread, andiii-sdkmay access the process environment from that thread. Therefore,std::env::remove_varafterproject_iiistarts can cause undefined behavior on non-Windows targets.InitOptions.metadatacannot overrideIII_WORKER_NAMEiniii-sdk0.22.1-alpha.25; add a per-registration override instead.🤖 Prompt for AI Agents
Source: MCP tools