Skip to content

feature: actionable error for legacy workers failing the pid handshake#51

Closed
rustatian wants to merge 3 commits into
masterfrom
feature/legacy-worker-handshake-diagnostics
Closed

feature: actionable error for legacy workers failing the pid handshake#51
rustatian wants to merge 3 commits into
masterfrom
feature/legacy-worker-handshake-diagnostics

Conversation

@rustatian

Copy link
Copy Markdown
Member
  • wrap pid-handshake failures (relay receive error, missing CONTROL flag, undecodable payload) with a hint pointing at the most likely cause — a worker SDK still speaking the legacy goridge v3 protocol (e.g. spiral/roadrunner-worker v3.x) — instead of surfacing a bare sync_worker_receive_frame: Network: EOF
  • covered by a unit test with an EOF relay
  • update dependencies

Copilot AI review requested due to automatic review settings June 10, 2026 20:43
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@rustatian, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 24 minutes and 20 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3edb1897-13e4-4f07-8f75-dcce0a2bed79

📥 Commits

Reviewing files that changed from the base of the PR and between bd0e52f and 50445c2.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • go.mod
  • internal/protocol.go
  • internal/protocol_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/legacy-worker-handshake-diagnostics

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves operator-facing diagnostics for worker PID handshakes by wrapping common handshake failures with an actionable hint that the worker may still be using the legacy Goridge v3 protocol (e.g., older spiral/roadrunner-worker), and updates a couple of Go dependencies.

Changes:

  • Add a legacyHint wrapper to annotate PID-handshake receive/flag/unmarshal failures with an upgrade hint while preserving the original error via %w.
  • Add a unit test that simulates an EOF during the handshake and asserts the hint is present.
  • Bump golang.org/x/sync and golang.org/x/sys.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
internal/protocol.go Wrap PID-handshake failure modes with a helpful “legacy Goridge v3” hint.
internal/protocol_test.go Add an EOF-based unit test verifying the hint is surfaced.
go.mod Bump golang.org/x/sync and golang.org/x/sys.
go.sum Add corresponding module sums for the bumped dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/protocol_test.go
Comment on lines +3 to +27
import (
"io"
"strings"
"testing"

"github.com/roadrunner-server/goridge/v4/pkg/frame"
)

// eofRelay accepts the outgoing control frame and then fails the read,
// mimicking a worker that exited on an unparseable (legacy-protocol) frame.
type eofRelay struct{}

func (eofRelay) Send(*frame.Frame) error { return nil }
func (eofRelay) Receive(*frame.Frame) error { return io.EOF }
func (eofRelay) Close() error { return nil }

func TestPidHandshakeHintsLegacyWorker(t *testing.T) {
_, err := Pid(eofRelay{})
if err == nil {
t.Fatal("expected the pid handshake to fail")
}
if !strings.Contains(err.Error(), "goridge v3") {
t.Fatalf("handshake error should hint at the legacy protocol, got: %v", err)
}
}
@rustatian

Copy link
Copy Markdown
Member Author

Closing for now: legacy-worker protocol failures (EOF on the pid handshake and similar) are expected during the v6 beta until the worker SDKs are updated to the goridge v4 protocol — per maintainer decision these are treated as known behavior, no extra diagnostics needed at this stage.

@rustatian rustatian closed this Jun 10, 2026
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.28%. Comparing base (bd0e52f) to head (50445c2).

Files with missing lines Patch % Lines
internal/protocol.go 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #51      +/-   ##
==========================================
+ Coverage   72.11%   72.28%   +0.17%     
==========================================
  Files          19       19              
  Lines        1492     1494       +2     
==========================================
+ Hits         1076     1080       +4     
+ Misses        363      361       -2     
  Partials       53       53              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

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