[management] revert ctx dependency in get account with backpressure#5878
[management] revert ctx dependency in get account with backpressure#5878
Conversation
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@management/server/account_request_buffer.go`:
- Around line 66-68: The current unconditional send to ac.getAccountRequestCh
and receive from req.ResultChan can block forever after
processGetAccountRequests() exits; change both operations to use select: when
sending the request to ac.getAccountRequestCh (where req is the request struct
with ResultChan), select between ac.getAccountRequestCh <- req, ctx.Done(), and
the buffer shutdown signal (the lifecycle stop channel used by
processGetAccountRequests()) so the caller can bail if its context is cancelled
or the buffer is shutting down; likewise, when waiting for the response, select
between <-req.ResultChan, ctx.Done(), and the same shutdown signal and return an
appropriate error on context cancel/shutdown instead of blocking indefinitely
(reference functions/values: getAccountRequestCh, processGetAccountRequests(),
req.ResultChan, ctx and the buffer lifecycle shutdown channel).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 66da488c-f5c9-4d2c-9b9c-145adb7f4023
📒 Files selected for processing (1)
management/server/account_request_buffer.go



Describe your changes
the pr revert ctx cancel dependency on GetAccountWithBackpressure
Issue ticket number and link
Stack
Checklist
Documentation
Select exactly one:
bug fix
Docs PR URL (required if "docs added" is checked)
Paste the PR link from https://github.com/netbirdio/docs here:
https://github.com/netbirdio/docs/pull/__
Summary by CodeRabbit