Skip to content

[feat] load balancing#118

Open
Jackmin801 wants to merge 3 commits intomainfrom
load-balancing
Open

[feat] load balancing#118
Jackmin801 wants to merge 3 commits intomainfrom
load-balancing

Conversation

@Jackmin801
Copy link
Member

No description provided.

@Jackmin801 Jackmin801 requested a review from Copilot June 25, 2025 05:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces distributed load balancing by routing validation requests to worker servers.

  • Adds a new FastAPI-based worker server for processing validation tasks
  • Integrates a DistributedValidationManager in the main server to route requests based on worker health and load
  • Exposes new environment variables and implements the manager for periodic health checks and request routing

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
worker_server.py New stateless FastAPI worker service handling single and group validation
server.py Injects DistributedValidationManager, adds branching for distributed vs. local validation
env.py Defines WORKER_URLS and ENABLE_DISTRIBUTED environment settings
distributed_validation.py Implements manager for health-checking workers and load-based routing
Comments suppressed due to low confidence (2)

toplocvalidator/server.py:41

  • The distributed_manager is declared but never instantiated or started. Without initialization (e.g. in your startup routine using env.WORKER_URLS and calling await distributed_manager.start()), all distributed branches will skip or error out.
distributed_manager: DistributedValidationManager | None = None

toplocvalidator/server.py:178

  • In the local branch you assign state but never set result. Later logic expects result to be defined (as per debug and distributed branches), which will lead to an undefined variable error. Add result = state.status after this call.
            state = await process_file(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants