Skip to content

Commit

Permalink
chore(cdp): Disable overflow routing (#24773)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Sep 4, 2024
1 parent 59de5a4 commit c254b61
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions plugin-server/src/cdp/cdp-consumers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,39 +400,8 @@ abstract class CdpConsumerBase {
})
})

const overflowGlobalsAndFunctions: Record<string, HogFunctionOverflowedGlobals> = {}

const notOverflowedInvocations = notMaskedInvocations.filter((item) => {
const state = states[item.hogFunction.id].state

if (state === HogWatcherState.degraded) {
const key = `${item.globals.project.id}-${item.globals.event.uuid}`
overflowGlobalsAndFunctions[key] = overflowGlobalsAndFunctions[key] || {
globals: item.globals,
hogFunctionIds: [],
}

overflowGlobalsAndFunctions[key].hogFunctionIds.push(item.hogFunction.id)
counterFunctionInvocation.inc({ outcome: 'overflowed' }, 1)
return false
}

return true
})

Object.values(overflowGlobalsAndFunctions).forEach((item) => {
this.messagesToProduce.push({
topic: KAFKA_CDP_FUNCTION_OVERFLOW,
value: {
source: 'event_invocations',
payload: item,
},
key: item.globals.event.uuid,
})
})

const results = (
await this.runManyWithHeartbeat(notOverflowedInvocations, (item) =>
await this.runManyWithHeartbeat(notMaskedInvocations, (item) =>
this.hogExecutor.executeFunction(item.globals, item.hogFunction)
)
).filter((x) => !!x) as HogFunctionInvocationResult[]
Expand Down

0 comments on commit c254b61

Please sign in to comment.