Skip to content

Fix connection reset logic to ensure the old subscribe goroutine is cancelled before a new connection is made#1700

Open
dhurley wants to merge 8 commits into
mainfrom
fix/connection-reset-operations-order
Open

Fix connection reset logic to ensure the old subscribe goroutine is cancelled before a new connection is made#1700
dhurley wants to merge 8 commits into
mainfrom
fix/connection-reset-operations-order

Conversation

@dhurley

@dhurley dhurley commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Proposed changes

  • A gRPC server that is tracking connections could remove a connection when the Subscribe stream is closed by the client and then track a connection again if it receives a CreateConnection RPC call. So we need to ensure that the old subscribe goroutine is cancelled before a new connection is made when a connection reset happens to ensure that the server is able to track connections.
  • Also I spotted a potential race condition in file service operator so I provided a fix for that as well.
  • Updated ValidateGrpcError function to return permanent error for NotFound, AlreadyExists, PermissionDenied or Unauthenticated gRPC errors.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

… reset logic to ensure the old subscribe goroutine is cancelled before a new connection is made.
@github-actions github-actions Bot added bug Something isn't working chore Pull requests for routine tasks labels May 28, 2026
@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.19048% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.99%. Comparing base (721944d) to head (5f9e2e3).
⚠️ Report is 48 commits behind head on main.

Files with missing lines Patch % Lines
internal/file/file_service_operator.go 72.72% 2 Missing and 4 partials ⚠️
internal/command/command_plugin.go 76.47% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1700      +/-   ##
==========================================
- Coverage   85.00%   84.99%   -0.01%     
==========================================
  Files         105      105              
  Lines       13593    13625      +32     
==========================================
+ Hits        11555    11581      +26     
- Misses       1524     1527       +3     
- Partials      514      517       +3     
Files with missing lines Coverage Δ
internal/grpc/grpc.go 81.57% <100.00%> (+0.16%) ⬆️
internal/command/command_plugin.go 71.60% <76.47%> (+0.79%) ⬆️
internal/file/file_service_operator.go 77.81% <72.72%> (+0.27%) ⬆️

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 721944d...5f9e2e3. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread internal/command/command_plugin.go
Comment thread internal/command/command_plugin.go Outdated
@dhurley dhurley marked this pull request as ready for review June 3, 2026 12:45
@dhurley dhurley requested a review from a team as a code owner June 3, 2026 12:45
Comment thread internal/file/file_service_operator.go Outdated
@dhurley dhurley requested a review from aphralG June 8, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working chore Pull requests for routine tasks dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants