Pre-validate connections before batching#208
Open
jkurashcvx wants to merge 4 commits into
Open
Conversation
added 4 commits
May 12, 2026 13:49
Move socket IO (cookie read + connection string parse) out of addprocs_locked into validate_connection(), which runs with a configurable timeout (JULIA_AZMANAGERS_VALIDATION_TIMEOUT, default 30s) before sockets enter the batch. Only validated WorkerConfig objects are batched and passed to addprocs. Cherry-picked from hotfix/prevalidate-connections (release-3 hotfix).
validate_connection was called synchronously in the batch loop, causing connections to serialize (up to 30s each). Move validation into add_pending_connections via @async so all sockets validate in parallel. process_pending_connections now reads from pending_validated channel (instant take of pre-validated WorkerConfigs).
…ests - Run socket validations concurrently via @async in add_pending_connections instead of serially in process_pending_connections. Adds pending_validated channel so batch loop reads pre-validated WorkerConfigs instantly. - Downgrade validation failure log from @warn to @debug (expected operational outcome, not a warning). - Add test_validate_connections.jl with unit tests (good/slow/dead/bad-cookie sockets) and pipeline integration test exercising the full accept → async validate → pending_validated channel flow.
…ntax Cherry-picked from hotfix/prevalidate-connections (release-3): - Run socket validations concurrently via @async in add_pending_connections - Downgrade validation failure log from @warn to @debug - Add test_validate_connections.jl (unit + pipeline integration tests) - Fix _::AzManager write-only identifier for Julia 1.12
samtkaplan
approved these changes
May 14, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Move socket IO (cookie read + connection string parse) out of addprocs_locked into validate_connection(), which runs with a configurable timeout (JULIA_AZMANAGERS_VALIDATION_TIMEOUT, default 30s) before sockets enter the batch. Only validated WorkerConfig objects are batched and passed to addprocs.
Problem: Raw TCPSocket objects handed to addprocs_locked → launch → launch_on_machine could block on read() if a VM was slow/dead, holding worker_lock and causing other workers in the batch to time out and drop.
Changes:
Cherry-picked from hotfix/prevalidate-connections (release-3 hotfix).