Skip to content

fix(processor): replace panic with graceful error in activePartitions - #7181

Open
sriman0707 wants to merge 4 commits into
rudderlabs:masterfrom
sriman0707:fix/processor-active-partitions-panic
Open

fix(processor): replace panic with graceful error in activePartitions#7181
sriman0707 wants to merge 4 commits into
rudderlabs:masterfrom
sriman0707:fix/processor-active-partitions-panic

Conversation

@sriman0707

Copy link
Copy Markdown

Description

Replaces a panic(err) call in processor.activePartitions() with graceful error handling.

Previously, when the database connection was temporarily lost, activePartitions() would panic. This panic terminated the runner's pinger goroutine, silently crashing the active event-processing loop.

With this change, the handler logs the connection error, records a metric, and returns an empty partition list. This allows the pinger loop to gracefully retry fetching active partitions on the next tick once the database recovers.

Linear Ticket

N/A (External Open Source Contribution)

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@contributor-support

Copy link
Copy Markdown

Thank you @sriman0707 for contributing this PR.
Please sign the Contributor License Agreement (CLA) before merging.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

This PR is considered to be stale. It has been open 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR.

@github-actions github-actions Bot added the Stale label Aug 6, 2026
@sriman0707

Copy link
Copy Markdown
Author

Hi maintainers,

Just a friendly follow-up on this PR.

I have completed the CLA requirements and kept the branch up to date with the latest master. The change replaces a panic with graceful error handling, preventing the processor loop from terminating when the database connection is temporarily unavailable.

I'd appreciate it if someone could take a look when you have time. If there are any changes, tests, or improvements you'd like me to make, I'm happy to update the PR.

Thanks for your time and for maintaining RudderStack!

@github-actions github-actions Bot removed the Stale label Aug 10, 2026
@gitcommitshow

Copy link
Copy Markdown
Collaborator

Thanks for the PR @sriman0707
Can you please help me understand few more things

  1. Was any AI was used in creating this PR?
  2. How did you discover the problem you are fixing in this PR?

@sriman0707

Copy link
Copy Markdown
Author

Thanks for asking!

  1. Was AI used in creating this PR?
    Yes. I used Antigravity with my own custom security skill file to assist with the source-code analysis. I first went through SAST and then used the workflow to investigate the relevant source-code paths and understand the issue. The analysis and changes were reviewed and validated by me before creating the PR.

  2. How did you discover the problem you are fixing in this PR?
    I initially identified the area through SAST analysis and then investigated the relevant source code to understand how "activePartitions" was being handled. During the source-code review, I found that the current behavior could result in a panic under certain conditions instead of handling the situation gracefully. I reproduced/validated the behavior, worked on the fix, and then created this PR to replace the panic with graceful error handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants