Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove promise queue from batch manager #27905

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,11 @@ export class SessionRecordingIngester {
}

private async processMessages(parsedMessages: MessageWithTeam[]) {
await this.sessionBatchManager.withBatch(async (batch) => {
for (const message of parsedMessages) {
this.consume(message, batch)
}
return Promise.resolve()
})
const batch = this.sessionBatchManager.getCurrentBatch()
for (const message of parsedMessages) {
this.consume(message, batch)
}
return Promise.resolve()
}

private consume(message: MessageWithTeam, batch: SessionBatchRecorder) {
Expand Down Expand Up @@ -287,19 +286,20 @@ export class SessionRecordingIngester {
return this.assignedTopicPartitions.map((x) => x.partition)
}

private async onRevokePartitions(topicPartitions: TopicPartition[]): Promise<void> {
private onRevokePartitions(topicPartitions: TopicPartition[]): Promise<void> {
/**
* The revoke_partitions indicates that the consumer group has had partitions revoked.
* As a result, we need to drop all sessions currently managed for the revoked partitions
*/

const revokedPartitions = topicPartitions.map((x) => x.partition)
if (!revokedPartitions.length) {
return
return Promise.resolve()
}

SessionRecordingIngesterMetrics.resetSessionsHandled()
await this.sessionBatchManager.discardPartitions(revokedPartitions)
this.sessionBatchManager.discardPartitions(revokedPartitions)
return Promise.resolve()
}

private async commitOffsets(offsets: TopicPartitionOffset[]): Promise<void> {
Expand Down

This file was deleted.

Loading