Skip to content

Conversation

@kaushikmitr
Copy link

This pull request introduces several new helper modules and refactors the SLO-aware router in the scheduling framework to improve configurability, prediction handling, and internal data management. The main changes include adding support for environment-based configuration, modularizing prediction and selection logic, and making the SLO context store thread-safe.

Key changes:

Configuration and Environment Variable Support

  • Added config.go to provide environment-variable-driven configuration for SLO-aware routing, including weights, selection strategies, and exploration parameters. This makes the router highly configurable without code changes.

Prediction and Selection Logic Modularization

  • Introduced prediction.go to encapsulate prediction generation, validation, and SLO headroom calculation for candidate pods, improving code clarity and separation of concerns.
  • Added helpers.go with composite scoring and weighted random/max selection logic for pod selection, supporting new composite strategies and selection modes.

Request Header Parsing

  • Added headers.go with utility functions for robust parsing of float and boolean headers from requests, including error handling for invalid or missing values.

SLO Context Store Refactor

  • Refactored the SLO context store to use a thread-safe sync.Map instead of a plain map, and updated all accessors to use Load, Store, and Delete methods for concurrency safety.

SLO Request Context Enhancements

  • The SLORequestContext now pre-initializes maps for prefix cache scores and prediction results, and records the request received timestamp for improved tracking and metrics. [1] [2]

@BenjaminBraunDev BenjaminBraunDev merged commit e2f9478 into BenjaminBraunDev:slo-aware-routing-stage-3 Nov 5, 2025
1 of 2 checks passed
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