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

Automatically pause Kafka consumers when database is down #901

Closed
nscuro opened this issue Nov 7, 2023 · 2 comments
Closed

Automatically pause Kafka consumers when database is down #901

nscuro opened this issue Nov 7, 2023 · 2 comments
Assignees
Labels
component/api-server domain/notifications domain/repo-meta-analysis domain/vuln-analysis enhancement New feature or request p2 Non-critical bugs, and features that help organizations to identify and reduce risk size/M Medium effort

Comments

@nscuro
Copy link
Member

nscuro commented Nov 7, 2023

Currently, when either API server or Hyades services are unable to connect to the database, the database health check will switch to DOWN state. When deployed to Kubernetes, this will cause the respective pods to be removed from receiving incoming HTTP traffic.

However, Kafka consumers (Kafka Streams, Parallel Consumer) will continue to receive records from the Kafka broker. In most cases, processing these records requires database access. While the database is unreachable, all processing is doomed to fail. It would be preferable to stop consuming during the database outage, and resume once it's available again.

Kafka Streams and Confluent Parallel Consumers can both be paused and resumed:

We need a way to detect when the database health checks start to fail, and pause consumers when it happens. Similarly, consumers must be started again when the health checks recover.

@nscuro nscuro added enhancement New feature or request p2 Non-critical bugs, and features that help organizations to identify and reduce risk domain/notifications domain/repo-meta-analysis domain/vuln-analysis size/M Medium effort component/api-server labels Nov 7, 2023
@nscuro
Copy link
Member Author

nscuro commented Nov 8, 2023

quarkusio/quarkus#36918

@nscuro nscuro mentioned this issue Nov 23, 2023
34 tasks
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 2, 2024
Decoupled from #509

This merely adds an API on top of which processors can be implemented. We can migrate processors one-by-one from Kafka Streams to this API. Majority of this work was already done in #509, but got out of date due to changed priorities. At the very least said PR is good to take inspiration from.

Relates to DependencyTrack/hyades#346
Relates to DependencyTrack/hyades#901
Relates to DependencyTrack/hyades#907

Signed-off-by: nscuro <[email protected]>
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 3, 2024
Decoupled from #509

This merely adds an API on top of which processors can be implemented. We can migrate processors one-by-one from Kafka Streams to this API. Majority of this work was already done in #509, but got out of date due to changed priorities. At the very least said PR is good to take inspiration from.

Relates to DependencyTrack/hyades#346
Relates to DependencyTrack/hyades#901
Relates to DependencyTrack/hyades#907

Signed-off-by: nscuro <[email protected]>
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 5, 2024
Decoupled from #509

This merely adds an API on top of which processors can be implemented. We can migrate processors one-by-one from Kafka Streams to this API. Majority of this work was already done in #509, but got out of date due to changed priorities. At the very least said PR is good to take inspiration from.

Relates to DependencyTrack/hyades#346
Relates to DependencyTrack/hyades#901
Relates to DependencyTrack/hyades#907

Signed-off-by: nscuro <[email protected]>
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 5, 2024
Decoupled from #509

This merely adds an API on top of which processors can be implemented. We can migrate processors one-by-one from Kafka Streams to this API. Majority of this work was already done in #509, but got out of date due to changed priorities. At the very least said PR is good to take inspiration from.

Relates to DependencyTrack/hyades#346
Relates to DependencyTrack/hyades#901
Relates to DependencyTrack/hyades#907

Signed-off-by: nscuro <[email protected]>
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 5, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 5, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 5, 2024
Decoupled from #509

This merely adds an API on top of which processors can be implemented. We can migrate processors one-by-one from Kafka Streams to this API. Majority of this work was already done in #509, but got out of date due to changed priorities. At the very least said PR is good to take inspiration from.

Relates to DependencyTrack/hyades#346
Relates to DependencyTrack/hyades#901
Relates to DependencyTrack/hyades#907

Signed-off-by: nscuro <[email protected]>
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 5, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 5, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 5, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 5, 2024
Decoupled from #509

This merely adds an API on top of which processors can be implemented. We can migrate processors one-by-one from Kafka Streams to this API. Majority of this work was already done in #509, but got out of date due to changed priorities. At the very least said PR is good to take inspiration from.

Relates to DependencyTrack/hyades#346
Relates to DependencyTrack/hyades#901
Relates to DependencyTrack/hyades#907

Signed-off-by: nscuro <[email protected]>
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 5, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 5, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 9, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 9, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 26, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 26, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 26, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Feb 26, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Mar 4, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Mar 4, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Mar 19, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Mar 19, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Mar 19, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Mar 22, 2024
nscuro added a commit to DependencyTrack/hyades-apiserver that referenced this issue Mar 25, 2024
@nscuro nscuro self-assigned this Apr 12, 2024
@nscuro
Copy link
Member Author

nscuro commented Jun 5, 2024

Closing, as the API server was migrated to Confluent parallel-consumer, which provides us with HOL blocking semantics.

@nscuro nscuro closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/api-server domain/notifications domain/repo-meta-analysis domain/vuln-analysis enhancement New feature or request p2 Non-critical bugs, and features that help organizations to identify and reduce risk size/M Medium effort
Projects
None yet
Development

No branches or pull requests

1 participant