feature: actionable error for legacy workers failing the pid handshake#51
feature: actionable error for legacy workers failing the pid handshake#51rustatian wants to merge 3 commits into
Conversation
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
✨ Finishing Touches🧪 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.
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
legacyHintwrapper 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/syncandgolang.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.
| 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) | ||
| } | ||
| } |
|
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. |
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
spiral/roadrunner-workerv3.x) — instead of surfacing a baresync_worker_receive_frame: Network: EOF