Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore: pick any unlocked partition in event prop job (#9811)

Steffen Schmitz65559b8da13a
diff --git a/worker/src/features/eventPropagation/handleEventPropagationJob.ts b/worker/src/features/eventPropagation/handleEventPropagationJob.ts
index 84c87bf67c..2e7f2204e7 100644
--- a/worker/src/features/eventPropagation/handleEventPropagationJob.ts
+++ b/worker/src/features/eventPropagation/handleEventPropagationJob.ts
@@ -144,19 +144,21 @@ export const handleEventPropagationJob = async (
if (partition) {
// Try to acquire lock for this partition
const lockAcquired = await acquirePartitionLock(partition);
- if (!lockAcquired) {
+ if (lockAcquired) {
+ partitionToProcess = partition;
logger.info(
- `Partition ${partition} is already locked by another worker, skipping`,
+ `Processing partition ${partitionToProcess} (targeted) for events table fill`,
+ );
+ } else {
+ logger.info(
+ `Partition ${partition} is already locked by another worker, falling back to discovery mode`,
);
- return;
}
+ }
- partitionToProcess = partition;
- logger.info(
- `Processing partition ${partitionToProcess} (targeted) for events table fill`,
- );
- } else {
- // Discovery mode (cron job) - process oldest safe partition
+ // If no partition was processed yet (either no partition specified or it was locked),
+ // fall back to discovery mode - process oldest safe partition
+ if (!partitionToProcess) {
// We sort partitions from newest to oldest and then remove elements from the back.
// This means that the oldest, unlocked element will be processed.
// Later, we can continue to process from the back until two elements remain.
@@ -369,7 +371,7 @@ export const handleEventPropagationJob = async (
operation_name: "dropPartition",
},
clickhouseConfigs: {
- request_timeout: 120000, // 2 minutes timeout
+ request_timeout: 180000, // 3 minutes timeout
},
});