🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
fix(worker): cap experiment backfill to 8-hour windows (#12952)
Steffen Schmitze42ba4d28dfb
diff --git a/worker/src/features/eventPropagation/handleExperimentBackfill.ts b/worker/src/features/eventPropagation/handleExperimentBackfill.tsindex d98e4cc647..7b9db2d805 100644--- a/worker/src/features/eventPropagation/handleExperimentBackfill.ts+++ b/worker/src/features/eventPropagation/handleExperimentBackfill.ts@@ -751,12 +751,21 @@ export async function runExperimentBackfill(): Promise<void> {// This ensures we don't process items that might still be receiving dataconst upperBound = new Date(Date.now() - 30 * 1000);- // Execute backfill- logger.info("[EXPERIMENT BACKFILL] Starting backfill process");- await processExperimentBackfill(lastRun, upperBound);+ // Cap each execution to an 8-hour window. The scheduler runs frequently+ // enough that consecutive jobs will catch up on any larger gap.+ const maxChunkMs = 8 * 60 * 60 * 1000;+ const chunkEnd = new Date(+ Math.min(lastRun.getTime() + maxChunkMs, upperBound.getTime()),+ );++ logger.info(+ `[EXPERIMENT BACKFILL] Processing chunk from ${lastRun.toISOString()} to ${chunkEnd.toISOString()}`,+ );+ await processExperimentBackfill(lastRun, chunkEnd);++ // Advance the persisted timestamp after successful processing+ await updateBackfillTimestamp(chunkEnd);- // Update timestamp with the upper bound we processed up to- await updateBackfillTimestamp(upperBound);logger.info("[EXPERIMENT BACKFILL] Backfill completed successfully");} catch (error) {logger.error("[EXPERIMENT BACKFILL] Failed to run backfill", error);